mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 07:17:50 +00:00
switch from connect to ecstatic for sauce tests, parse URL for compat in querystring and set header
This commit is contained in:
@@ -51,14 +51,14 @@ before_install:
|
||||
- "[ $BIN == 'rhino' ] && echo -e '#!/bin/sh\\njava -jar /opt/rhino-1.7R5/js.jar $@' | sudo tee /usr/local/bin/rhino && sudo chmod +x /usr/local/bin/rhino || true"
|
||||
- "[ $BIN == 'ringo' ] && wget http://ringojs.org/downloads/ringojs-0.9.zip && sudo unzip ringojs-0.9 -d /opt && rm ringojs-0.9.zip || true"
|
||||
- "[ $BIN == 'ringo' ] && sudo ln -s /opt/ringojs-0.9/bin/ringo /usr/local/bin/ringo && sudo chmod +x /usr/local/bin/ringo || true"
|
||||
- "[ $SAUCELABS != false ] && npm i connect request sauce-tunnel || true"
|
||||
- "[ $SAUCELABS != false ] && npm i ecstatic request sauce-tunnel || true"
|
||||
script:
|
||||
- "[ $BIN == 'istanbul' ] && $BIN cover ./test/test.js || true"
|
||||
- "[ $BUILD != false ] && [ $BUILD != 'compat' ] && MAKE=true || true"
|
||||
- "[ $MAKE != false ] && git clone --depth=1 --branch=master git://github.com/lodash/lodash-cli.git ./node_modules/lodash-cli || true"
|
||||
- "[ $MAKE != false ] && mkdir ./node_modules/lodash-cli/node_modules && cd ./node_modules/lodash-cli/node_modules/ && ln -s ../../../ ./lodash && cd ../ && npm i . && cd ../../ || true"
|
||||
- "[ $MAKE != false ] && node ./node_modules/lodash-cli/bin/lodash $BUILD -o ./dist/lodash.$BUILD.js || true"
|
||||
- "[ $BUILD != false ] && cd ./test || true"
|
||||
- "[ $BUILD != false ] && cd ./test || true"
|
||||
- "[ $BUILD == false ] && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.js"
|
||||
- "[ $BUILD == false ] && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.min.js"
|
||||
- "[ $SAUCELABS == false ] && true || node ./test/saucelabs.js"
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
;(function() {
|
||||
'use strict';
|
||||
|
||||
var connect = require('connect'),
|
||||
var ecstatic = require('ecstatic'),
|
||||
http = require('http'),
|
||||
path = require('path'),
|
||||
url = require('url'),
|
||||
request = require('request'),
|
||||
SauceTunnel = require('sauce-tunnel');
|
||||
|
||||
@@ -28,9 +30,18 @@
|
||||
];
|
||||
|
||||
// create a web server for the local dir
|
||||
var server = connect.createServer(
|
||||
connect.static(path.resolve(__dirname, '..'))
|
||||
).listen(port);
|
||||
var mount = ecstatic({
|
||||
root: path.resolve(__dirname, '..'),
|
||||
cache: false
|
||||
});
|
||||
http.createServer(function(req, res) {
|
||||
var parsedUrl = url.parse(req.url, true);
|
||||
var compat = parsedUrl.query.compat;
|
||||
if (compat) {
|
||||
res.setHeader('X-UA-Compatible', 'IE=' + compat);
|
||||
}
|
||||
mount(req, res);
|
||||
}).listen(port);
|
||||
|
||||
// set up sauce connect so we can use this server from saucelabs
|
||||
var tunnelTimeout = 10000,
|
||||
@@ -43,7 +54,7 @@
|
||||
console.log('Sauce connect tunnel opened');
|
||||
runTests();
|
||||
} else {
|
||||
console.error('Failed to open sauce connect tunnel')
|
||||
console.error('Failed to open sauce connect tunnel');
|
||||
process.exit(2);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user