Skip to content

Commit

Permalink
Update: Remove fs-extra devDep and use rimraf instead
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 21, 2017
1 parent 9d6db31 commit 73f1182
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@
"eslint": "^1.7.3",
"eslint-config-gulp": "^2.0.0",
"expect": "^1.20.2",
"fs-extra": "^0.26.1",
"github-changes": "^1.0.1",
"gulp": "gulpjs/gulp#4.0",
"gulp-test-tools": "^0.6.1",
"jscs": "^2.3.5",
"jscs-preset-gulp": "^1.0.0",
"marked-man": "^0.1.3",
"mocha": "^3.2.0",
"nyc": "^10.0.0"
"nyc": "^10.0.0",
"rimraf": "^2.6.1"
},
"keywords": [
"build",
Expand Down
45 changes: 22 additions & 23 deletions test/flags-tasks-json.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use strict';

var expect = require('expect');
var fs = require('fs-extra');
var fs = require('fs');
var path = require('path');
var rimraf = require('rimraf');
var skipLines = require('gulp-test-tools').skipLines;
var runner = require('gulp-test-tools').gulpRunner;

Expand All @@ -25,28 +26,26 @@ describe('flag: --tasks-json', function() {
});

it('writes the task list to file with path', function(done) {
fs.emptyDir(__dirname + '/output/', function(err) {
if (err) {
return done(err);
}

runner({ verbose: false })
.gulp('--tasks-json ../../output/tasks.json',
'--gulpfile ./test/fixtures/gulpfiles/gulpfile.js')
.run(cb);

function cb(err, stdout, stderr) {
expect(err).toEqual(null);
expect(stderr).toEqual('');
stdout = skipLines(stdout, 1);
expect(stdout).toEqual('');
var file = fs.readFileSync(__dirname + '/output/tasks.json', 'utf8');
var parsedJson = JSON.parse(file);
expect(parsedJson).toEqual(expected);
fs.removeSync(__dirname + '/output/');
done(err);
}
});
var output = path.join(__dirname, '/output/');
rimraf.sync(output);
fs.mkdirSync(output);

runner({ verbose: false })
.gulp('--tasks-json ../../output/tasks.json',
'--gulpfile ./test/fixtures/gulpfiles/gulpfile.js')
.run(cb);

function cb(err, stdout, stderr) {
expect(err).toEqual(null);
expect(stderr).toEqual('');
stdout = skipLines(stdout, 1);
expect(stdout).toEqual('');
var file = fs.readFileSync(path.join(output, '/tasks.json'), 'utf8');
var parsedJson = JSON.parse(file);
expect(parsedJson).toEqual(expected);
rimraf.sync(output);
done(err);
}
});

});

0 comments on commit 73f1182

Please sign in to comment.