diff --git a/.travis.yml b/.travis.yml index dfca6c30a..66fee7fc4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -71,10 +71,10 @@ script: - "([ $SAUCE_LABS != false ] || [ $BUILD == false ]) && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.js" - "([ $SAUCE_LABS != false ] || [ $BUILD == false ]) && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.min.js" - "([ $SAUCE_LABS == false ] || [ $BUILD == 'underscore' ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=lodash-$BUILD\" tags=\"$BUILD,production\"" + - "([ $SAUCE_LABS == false ] || [ $COMPAT == false ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=lodash-$BUILD\" tags=\"$BUILD,production,ie-compat-mode\" compatMode=7" - "([ $SAUCE_LABS == false ] || [ $BUILD == 'underscore' ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development\"" - - "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=lodash-$BUILD\" tags=\"$BUILD,production,backbone\"" - - "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development,backbone\"" + - "([ $SAUCE_LABS == false ] || [ $COMPAT == false ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development,ie-compat-mode\" compatMode=7" + - "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=lodash-$BUILD\" tags=\"$BUILD,production,backbone\"" + - "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development,backbone\"" - "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=lodash-$BUILD\" tags=\"$BUILD,production,underscore\"" - "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development,underscore\"" - - "([ $SAUCE_LABS == false ] || [ $COMPAT == false ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=lodash-$BUILD&compat=7\" tags=\"$BUILD,production,ie-compat-mode\"" - - "([ $SAUCE_LABS == false ] || [ $COMPAT == false ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=../dist/lodash.$BUILD.js&compat=7\" tags=\"$BUILD,development,ie-compat-mode\"" diff --git a/test/saucelabs.js b/test/saucelabs.js index b9d34834a..72b473caf 100644 --- a/test/saucelabs.js +++ b/test/saucelabs.js @@ -27,6 +27,10 @@ accessKey = process.env.SAUCE_ACCESS_KEY, tunnelId = 'lodash_' + process.env.TRAVIS_JOB_NUMBER; + var compatMode = process.argv.reduce(function(result, value) { + return optionToValue('compatMode', value) || result; + }, null); + var runner = process.argv.reduce(function(result, value) { value = optionToValue('runner', value); return value == null @@ -73,7 +77,7 @@ isModern = /\bmodern\b/i.test(runnerQuery.build); // platforms to test IE compat mode - if (runnerQuery.compat) { + if (compatMode) { platforms = [ ['WIN8.1', 'internet explorer', '11'], ['Windows 7', 'internet explorer', '10'], @@ -293,10 +297,9 @@ }); http.createServer(function(req, res) { - var compat = url.parse(req.url, true).query.compat; - if (compat) { - // see http://msdn.microsoft.com/en-us/library/ff955275(v=vs.85).aspx - res.setHeader('X-UA-Compatible', 'IE=' + compat); + // see http://msdn.microsoft.com/en-us/library/ff955275(v=vs.85).aspx + if (compatMode && path.extname(url.parse(req.url).pathname) == '.html') { + res.setHeader('X-UA-Compatible', 'IE=' + compatMode); } mount(req, res); }).listen(port);