2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-11 18:02:32 +03:00

Gettings tests passing for IE9

This commit is contained in:
Matt Zabriskie
2016-03-09 16:17:10 -07:00
parent dcbb352262
commit 4d2f9c21d4
4 changed files with 19 additions and 5 deletions
+8 -1
View File
@@ -1,6 +1,8 @@
// 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')
})
]
},
+2 -1
View File
@@ -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;
+1 -1
View File
@@ -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",
+8 -2
View File
@@ -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;