提交 4d2f9c21 编写于 作者: M Matt Zabriskie

Gettings tests passing for IE9

上级 dcbb3522
// Karma configuration
// Generated on Fri Aug 15 2014 23:11:13 GMT-0500 (CDT)
var webpack = require('webpack');
function createCustomLauncher(browser, version, platform) {
return {
base: 'SauceLabs',
......@@ -70,7 +72,7 @@ module.exports = function(config) {
if (runAll || process.env.SAUCE_IE) {
// TODO These need to be fixed
// customLaunchers.SL_IE8 = createCustomLauncher('internet explorer', 8, 'Windows 7');
// customLaunchers.SL_IE9 = createCustomLauncher('internet explorer', 9, 'Windows 2008');
customLaunchers.SL_IE9 = createCustomLauncher('internet explorer', 9, 'Windows 2008');
customLaunchers.SL_IE10 = createCustomLauncher('internet explorer', 10, 'Windows 2012');
customLaunchers.SL_IE11 = createCustomLauncher('internet explorer', 11, 'Windows 8.1');
}
......@@ -183,6 +185,11 @@ module.exports = function(config) {
{
'./adapters/http': 'var undefined'
}
],
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('test')
})
]
},
......
......@@ -21,7 +21,8 @@ module.exports = function xhrAdapter(resolve, reject, config) {
// For IE 8/9 CORS support
// Only supports POST and GET calls and doesn't returns the response headers.
if (window.XDomainRequest && !('withCredentials' in request) && !isURLSameOrigin(config.url)) {
// DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.
if (process.env.NODE_ENV !== 'test' && window.XDomainRequest && !('withCredentials' in request) && !isURLSameOrigin(config.url)) {
request = new window.XDomainRequest();
loadEvent = 'onload';
xDomain = true;
......
......@@ -4,7 +4,7 @@
"description": "Promise based HTTP client for the browser and node.js",
"main": "index.js",
"scripts": {
"build": "./node_modules/.bin/grunt build",
"build": "NODE_ENV=production ./node_modules/.bin/grunt build",
"test": "./node_modules/.bin/grunt test",
"start": "node ./sandbox/server.js",
"examples": "node ./examples/server.js",
......
......@@ -22,15 +22,21 @@ function generateConfig(name) {
],
devtool: 'source-map'
};
config.plugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
})
];
if (uglify) {
config.plugins = [
config.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
})
];
);
}
return config;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册