Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github
fetch
提交
b043384e
F
fetch
项目概览
github
/
fetch
大约 1 年 前同步成功
通知
30
Star
25765
Fork
3216
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fetch
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b043384e
编写于
1月 10, 2016
作者:
M
Mislav Marohnić
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Render main test suite as root resource of test server
上级
667995fd
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
29 addition
and
19 deletion
+29
-19
script/phantomjs
script/phantomjs
+13
-2
script/saucelabs
script/saucelabs
+1
-1
script/server
script/server
+1
-0
test/test-worker.html
test/test-worker.html
+3
-3
test/test.html
test/test.html
+6
-7
test/worker.js
test/worker.js
+5
-6
未找到文件。
script/phantomjs
浏览文件 @
b043384e
...
...
@@ -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
script/saucelabs
浏览文件 @
b043384e
...
...
@@ -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
...
...
script/server
浏览文件 @
b043384e
...
...
@@ -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
});
...
...
test/test-worker.html
浏览文件 @
b043384e
...
...
@@ -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
)
{
...
...
test/test.html
浏览文件 @
b043384e
...
...
@@ -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
)
{
...
...
test/worker.js
浏览文件 @
b043384e
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录