Skip to content

Commit

Permalink
chore: Add a test case for config file in current dir (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
sttk authored Jan 25, 2024
1 parent 0a35a9e commit f71effa
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/config-flags-gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,15 @@ describe('config: flags.gulpfile', function() {
}
});

it('Should not find up but use config file in current directory', function(done) {
var opts = { cwd: path.join(baseDir, 'use-current-cfg/current-dir') };
exec(gulp(), opts, cb);

function cb(err, stdout, stderr) {
expect(err).toBeNull();
expect(stderr).toEqual('');
expect(sliceLines(stdout, 3, 4)).toEqual(path.join(opts.cwd, 'gulpfile-2.js'));
done(err);
}
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
flags: {
gulpfile: './gulpfile-2.js',
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

var gulp = require('gulp');

gulp.task('default', function(done) {
console.log(__filename);
done();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

var gulp = require('gulp');

gulp.task('default', function(done) {
console.log(__filename);
done();
});

0 comments on commit f71effa

Please sign in to comment.