2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-23 20:40:40 +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 // Karma configuration
// Generated on Fri Aug 15 2014 23:11:13 GMT-0500 (CDT) // Generated on Fri Aug 15 2014 23:11:13 GMT-0500 (CDT)
var webpack = require('webpack');
function createCustomLauncher(browser, version, platform) { function createCustomLauncher(browser, version, platform) {
return { return {
base: 'SauceLabs', base: 'SauceLabs',
@@ -70,7 +72,7 @@ module.exports = function(config) {
if (runAll || process.env.SAUCE_IE) { if (runAll || process.env.SAUCE_IE) {
// TODO These need to be fixed // TODO These need to be fixed
// customLaunchers.SL_IE8 = createCustomLauncher('internet explorer', 8, 'Windows 7'); // 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_IE10 = createCustomLauncher('internet explorer', 10, 'Windows 2012');
customLaunchers.SL_IE11 = createCustomLauncher('internet explorer', 11, 'Windows 8.1'); customLaunchers.SL_IE11 = createCustomLauncher('internet explorer', 11, 'Windows 8.1');
} }
@@ -183,6 +185,11 @@ module.exports = function(config) {
{ {
'./adapters/http': 'var undefined' './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 // For IE 8/9 CORS support
// Only supports POST and GET calls and doesn't returns the response headers. // 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(); request = new window.XDomainRequest();
loadEvent = 'onload'; loadEvent = 'onload';
xDomain = true; xDomain = true;
+1 -1
View File
@@ -4,7 +4,7 @@
"description": "Promise based HTTP client for the browser and node.js", "description": "Promise based HTTP client for the browser and node.js",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"build": "./node_modules/.bin/grunt build", "build": "NODE_ENV=production ./node_modules/.bin/grunt build",
"test": "./node_modules/.bin/grunt test", "test": "./node_modules/.bin/grunt test",
"start": "node ./sandbox/server.js", "start": "node ./sandbox/server.js",
"examples": "node ./examples/server.js", "examples": "node ./examples/server.js",
+8 -2
View File
@@ -23,14 +23,20 @@ function generateConfig(name) {
devtool: 'source-map' devtool: 'source-map'
}; };
config.plugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
})
];
if (uglify) { if (uglify) {
config.plugins = [ config.plugins.push(
new webpack.optimize.UglifyJsPlugin({ new webpack.optimize.UglifyJsPlugin({
compressor: { compressor: {
warnings: false warnings: false
} }
}) })
]; );
} }
return config; return config;