Skip to content

Commit

Permalink
Fix: Make linting pass & add pretest hook
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jun 23, 2016
1 parent c36a2c1 commit 52c3cad
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 33 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
],
"scripts": {
"lint": "eslint . && jscs index.js test/",
"pretest": "npm run lint",
"test": "mocha --async-only",
"cover": "istanbul cover _mocha --report lcovonly",
"coveralls": "npm run cover && istanbul-coveralls"
Expand Down
46 changes: 23 additions & 23 deletions test/fixtures/taskTree/aliasNested.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ module.exports = {
{
label: 'noop',
type: 'task',
nodes: []
nodes: [],
},
{
label: 'fn1',
type: 'task',
nodes: []
nodes: [],
},
{
label: 'fn2',
type: 'task',
nodes: []
nodes: [],
},
{
label: 'fn3',
type: 'task',
nodes: []
nodes: [],
},
{
label: 'ser',
Expand All @@ -35,31 +35,31 @@ module.exports = {
{
label: 'noop',
type: 'function',
nodes: []
nodes: [],
},
{
label: '<anonymous>',
type: 'function',
nodes: []
nodes: [],
},
{
label: 'fn1',
type: 'task',
nodes: []
nodes: [],
},
{
label: 'fn2',
type: 'task',
nodes: []
nodes: [],
},
{
label: 'fn3',
type: 'task',
nodes: []
}
]
}
]
nodes: [],
},
],
},
],
},
{
label: 'par',
Expand All @@ -73,31 +73,31 @@ module.exports = {
{
label: 'noop',
type: 'function',
nodes: []
nodes: [],
},
{
label: '<anonymous>',
type: 'function',
nodes: []
nodes: [],
},
{
label: 'fn1',
type: 'task',
nodes: []
nodes: [],
},
{
label: 'fn2',
type: 'task',
nodes: []
nodes: [],
},
{
label: 'fn3',
type: 'task',
nodes: []
}
]
}
]
}
nodes: [],
},
],
},
],
},
],
};
12 changes: 6 additions & 6 deletions test/fixtures/taskTree/aliasSimple.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ module.exports = {
{
label: 'noop',
type: 'task',
nodes: []
nodes: [],
},
{
label: 'fn1',
type: 'task',
nodes: []
nodes: [],
},
{
label: 'fn2',
type: 'task',
nodes: []
nodes: [],
},
{
label: 'fn3',
type: 'task',
nodes: []
nodes: [],
},
{
label: 'fn4',
type: 'task',
nodes: []
}
nodes: [],
},
],
};
9 changes: 7 additions & 2 deletions test/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ describe('integrations', function() {

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

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

function userEdit(cb) {
fs.appendFile(path.join(__dirname, './fixtures/tmp/testMore.js'), ' ', cb);
fs.appendFile(filepath, ' ', cb);
}

function cleanup(cb) {
fs.unlink(filepath, cb);
}

function countEditedFiles() {
Expand All @@ -138,7 +143,7 @@ describe('integrations', function() {
}));
}

taker.series(setup, 'build', userWait, userEdit, countEditedFiles, function(cb) {
taker.series(setup, 'build', userWait, userEdit, countEditedFiles, cleanup, function(cb) {
expect(count).toEqual(1);
cb();
})(done);
Expand Down
4 changes: 2 additions & 2 deletions test/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('task', function() {
});

taker.parallel('foo', 'bar', function(cb) {
setTimeout(function(){
setTimeout(function() {
expect(count).toEqual(4);
cb();
}, 500);
Expand Down Expand Up @@ -149,7 +149,7 @@ describe('task', function() {
});

taker.series('bar', function(cb) {
setTimeout(function(){
setTimeout(function() {
expect(count).toEqual(6);
cb();
}, 500);
Expand Down

0 comments on commit 52c3cad

Please sign in to comment.