Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcad8699

Browse files
committed
update@test tests
1 parentb7cc085 commitcad8699

File tree

1 file changed

+24
-30
lines changed

1 file changed

+24
-30
lines changed

‎test/test.spec.js

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,39 @@
1-
varexpect=require('chai').expect;
2-
vartask=require('../lib/build/parser/task').task;
3-
vartrim=require('../lib/build/parser/actions').trimCommandValue;
1+
const{expect}=require('chai');
2+
const{task}=require('../lib/build/parser/task');
3+
consttrim=require('../lib/build/parser/actions').trimCommandValue;
44

5-
varresult=function(){
6-
return{
7-
chapters:[{
8-
pages:[{
9-
tasks:[]
10-
}]
11-
}]
12-
};
13-
};
14-
varindex=function(){
15-
return{
16-
chapter:0,
17-
page:0,
18-
task:-1
19-
};
20-
};
5+
constresult=()=>({
6+
pages:[{
7+
tasks:[]
8+
}]
9+
});
2110

22-
describe('@test',function(){
11+
constindex=()=>({
12+
page:0,
13+
task:-1
14+
});
2315

24-
it('should take a single test file',function(){
25-
varlines=['+ Task One','',"@test('path/to/test.js')"];
26-
varnext=task(result(),lines,index());
27-
varnextTask=next.chapters[0].pages[0].tasks[0];
16+
describe('@test',()=>{
17+
18+
it('should take a single test file',()=>{
19+
constlines=['+ Task One','',"@test('path/to/test.js')"];
20+
constnext=task({result:result(), lines,index:index()});
21+
constnextTask=next.pages[0].tasks[0];
2822
expect(nextTask).to.deep.equal({
2923
tests:[
30-
"path/to/test.js"
24+
'path/to/test.js'
3125
],
3226
description:'Task One\n'
3327
});
3428
});
3529

36-
it('should take an array of test files',function(){
37-
varlines=['+ Task One','',"@test(['path/to/test.js', 'path/to/test2.js'])"];
38-
varnext=task(result(),lines,index());
39-
varnextTask=next.chapters[0].pages[0].tasks[0];
30+
it('should take an array of test files',()=>{
31+
constlines=['+ Task One','',"@test(['path/to/test.js', 'path/to/test2.js'])"];
32+
constnext=task({result:result(), lines,index:index()});
33+
constnextTask=next.pages[0].tasks[0];
4034
expect(nextTask).to.deep.equal({
4135
tests:[
42-
"path/to/test.js","path/to/test2.js"
36+
'path/to/test.js','path/to/test2.js'
4337
],
4438
description:'Task One\n'
4539
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp