Skip to content

Commit 52c3cad

Browse files
committed
Fix: Make linting pass & add pretest hook
1 parent c36a2c1 commit 52c3cad

File tree

5 files changed

+39
-33
lines changed

5 files changed

+39
-33
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
],
2020
"scripts": {
2121
"lint": "eslint . && jscs index.js test/",
22+
"pretest": "npm run lint",
2223
"test": "mocha --async-only",
2324
"cover": "istanbul cover _mocha --report lcovonly",
2425
"coveralls": "npm run cover && istanbul-coveralls"

test/fixtures/taskTree/aliasNested.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ module.exports = {
66
{
77
label: 'noop',
88
type: 'task',
9-
nodes: []
9+
nodes: [],
1010
},
1111
{
1212
label: 'fn1',
1313
type: 'task',
14-
nodes: []
14+
nodes: [],
1515
},
1616
{
1717
label: 'fn2',
1818
type: 'task',
19-
nodes: []
19+
nodes: [],
2020
},
2121
{
2222
label: 'fn3',
2323
type: 'task',
24-
nodes: []
24+
nodes: [],
2525
},
2626
{
2727
label: 'ser',
@@ -35,31 +35,31 @@ module.exports = {
3535
{
3636
label: 'noop',
3737
type: 'function',
38-
nodes: []
38+
nodes: [],
3939
},
4040
{
4141
label: '<anonymous>',
4242
type: 'function',
43-
nodes: []
43+
nodes: [],
4444
},
4545
{
4646
label: 'fn1',
4747
type: 'task',
48-
nodes: []
48+
nodes: [],
4949
},
5050
{
5151
label: 'fn2',
5252
type: 'task',
53-
nodes: []
53+
nodes: [],
5454
},
5555
{
5656
label: 'fn3',
5757
type: 'task',
58-
nodes: []
59-
}
60-
]
61-
}
62-
]
58+
nodes: [],
59+
},
60+
],
61+
},
62+
],
6363
},
6464
{
6565
label: 'par',
@@ -73,31 +73,31 @@ module.exports = {
7373
{
7474
label: 'noop',
7575
type: 'function',
76-
nodes: []
76+
nodes: [],
7777
},
7878
{
7979
label: '<anonymous>',
8080
type: 'function',
81-
nodes: []
81+
nodes: [],
8282
},
8383
{
8484
label: 'fn1',
8585
type: 'task',
86-
nodes: []
86+
nodes: [],
8787
},
8888
{
8989
label: 'fn2',
9090
type: 'task',
91-
nodes: []
91+
nodes: [],
9292
},
9393
{
9494
label: 'fn3',
9595
type: 'task',
96-
nodes: []
97-
}
98-
]
99-
}
100-
]
101-
}
96+
nodes: [],
97+
},
98+
],
99+
},
100+
],
101+
},
102102
],
103103
};

test/fixtures/taskTree/aliasSimple.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ module.exports = {
66
{
77
label: 'noop',
88
type: 'task',
9-
nodes: []
9+
nodes: [],
1010
},
1111
{
1212
label: 'fn1',
1313
type: 'task',
14-
nodes: []
14+
nodes: [],
1515
},
1616
{
1717
label: 'fn2',
1818
type: 'task',
19-
nodes: []
19+
nodes: [],
2020
},
2121
{
2222
label: 'fn3',
2323
type: 'task',
24-
nodes: []
24+
nodes: [],
2525
},
2626
{
2727
label: 'fn4',
2828
type: 'task',
29-
nodes: []
30-
}
29+
nodes: [],
30+
},
3131
],
3232
};

test/integration.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ describe('integrations', function() {
110110

111111
it('can use lastRun with vinyl.src `since` option', function(done) {
112112
var count = 0;
113+
var filepath = path.join(__dirname, './fixtures/tmp/testMore.js');
113114

114115
function setup() {
115116
return vinyl.src('./fixtures/test*.js', { cwd: __dirname })
@@ -127,7 +128,11 @@ describe('integrations', function() {
127128
}
128129

129130
function userEdit(cb) {
130-
fs.appendFile(path.join(__dirname, './fixtures/tmp/testMore.js'), ' ', cb);
131+
fs.appendFile(filepath, ' ', cb);
132+
}
133+
134+
function cleanup(cb) {
135+
fs.unlink(filepath, cb);
131136
}
132137

133138
function countEditedFiles() {
@@ -138,7 +143,7 @@ describe('integrations', function() {
138143
}));
139144
}
140145

141-
taker.series(setup, 'build', userWait, userEdit, countEditedFiles, function(cb) {
146+
taker.series(setup, 'build', userWait, userEdit, countEditedFiles, cleanup, function(cb) {
142147
expect(count).toEqual(1);
143148
cb();
144149
})(done);

test/task.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ describe('task', function() {
117117
});
118118

119119
taker.parallel('foo', 'bar', function(cb) {
120-
setTimeout(function(){
120+
setTimeout(function() {
121121
expect(count).toEqual(4);
122122
cb();
123123
}, 500);
@@ -149,7 +149,7 @@ describe('task', function() {
149149
});
150150

151151
taker.series('bar', function(cb) {
152-
setTimeout(function(){
152+
setTimeout(function() {
153153
expect(count).toEqual(6);
154154
cb();
155155
}, 500);

0 commit comments

Comments
 (0)