Move compat mode testing to an argument instead of a query param.

This commit is contained in:
John-David Dalton
2013-11-14 08:47:34 -08:00
parent e7ffb80877
commit c42b63b008
2 changed files with 12 additions and 9 deletions

View File

@@ -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\""

View File

@@ -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);