提交 b043384e 编写于 作者: M Mislav Marohnić

Render main test suite as root resource of test server

上级 667995fd
......@@ -12,5 +12,16 @@ node ./script/server $port &>/dev/null &
server_pid=$!
trap "kill $server_pid" INT EXIT
node ./node_modules/.bin/mocha-phantomjs -s localToRemoteUrlAccessEnabled=true -s webSecurityEnabled=false "http://localhost:$port/test/test.html"
node ./node_modules/.bin/mocha-phantomjs -s localToRemoteUrlAccessEnabled=true -s webSecurityEnabled=false "http://localhost:$port/test/test-worker.html"
STATUS=0
run() {
node ./node_modules/.bin/mocha-phantomjs \
-s localToRemoteUrlAccessEnabled=true \
-s webSecurityEnabled=false \
"$@" || STATUS=$?
}
run "http://localhost:$port/"
run "http://localhost:$port/test/test-worker.html"
exit $STATUS
......@@ -25,7 +25,7 @@ job="$(./script/saucelabs-api --raw "js-tests" <<JSON
"tags": ["$TRAVIS_PULL_REQUEST", "$TRAVIS_BRANCH"],
"tunnel-identifier": "$TRAVIS_JOB_NUMBER",
"platforms": [["$SAUCE_PLATFORM", "$SAUCE_BROWSER", "$SAUCE_VERSION"]],
"url": "http://localhost:$port/test/test.html",
"url": "http://localhost:$port/",
"framework": "mocha"
}
JSON
......
......@@ -129,6 +129,7 @@ server = http.createServer(function(req, res) {
if (route) {
route(res, req);
} else {
if (pathname == '/') pathname = '/test/test.html'
fs.readFile(__dirname + '/..' + pathname, function(err, data) {
if (err) {
res.writeHead(404, {'Content-Type': types.txt});
......
......@@ -3,16 +3,16 @@
<head>
<meta charset="utf-8">
<title>Fetch Worker Tests</title>
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
<link rel="stylesheet" href="/node_modules/mocha/mocha.css" />
</head>
<body>
<div id="mocha"></div>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="/node_modules/mocha/mocha.js"></script>
<script>
mocha.setup('tdd')
var worker = new Worker('worker.js')
var worker = new Worker('/test/worker.js')
worker.addEventListener('message', function(e) {
switch (e.data.name) {
......
......@@ -3,21 +3,20 @@
<head>
<meta charset="utf-8">
<title>Fetch Tests</title>
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
<link rel="stylesheet" href="/node_modules/mocha/mocha.css" />
</head>
<body>
<div id="mocha"></div>
<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="/node_modules/chai/chai.js"></script>
<script src="/node_modules/mocha/mocha.js"></script>
<script>
mocha.setup('tdd')
self.assert = chai.assert
</script>
<script src="../bower_components/es6-promise/promise.js"></script>
<script src="../fetch.js"></script>
<script src="test.js"></script>
<script src="/bower_components/es6-promise/promise.js"></script>
<script src="/test/test.js"></script>
<script src="/fetch.js"></script>
<script>
if (self.mochaPhantomJS) {
......
importScripts('../node_modules/chai/chai.js')
importScripts('../node_modules/mocha/mocha.js')
importScripts('/node_modules/chai/chai.js')
importScripts('/node_modules/mocha/mocha.js')
mocha.setup('tdd')
self.assert = chai.assert
importScripts('../bower_components/es6-promise/promise.js')
importScripts('../fetch.js')
importScripts('test.js')
importScripts('/bower_components/es6-promise/promise.js')
importScripts('/test/test.js')
importScripts('/fetch.js')
function title(test) {
return test.fullTitle().replace(/#/g, '');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册