in my Gruntfile.js
I have the following:
grunt.initConfig({
remove: {
default_options: {
trace: false,
fileList: [
'tests/browser/libs.js',
'tests/browser/tests.js'
]
}
},
browserify: {
test: {
src: ['src/*.js', 'tests/browser/editor.js'],
dest: 'tests/browser/single.js'
},
tests: {
src: ['tests/browser/*.js'],
dest: 'tests/browser/tests.js'
},
libs: {
src: ['src/*.js'],
dest: 'tests/browser/libs.js'
}
},
mocha_phantomjs: {
all: ['tests/browser/*.html']
, single: ['tests/browser/single.html']
}
});
grunt.registerTask('test-x', ['remove', 'browserify:test', 'mocha_phantomjs:single']);
grunt.registerTask('test-web', ['remove', 'browserify', 'mocha_phantomjs']);
where the idea is that I should either be able to run all tests, or run a specific test file... but I have issues with it:
$ grunt test-web
Running "remove:default_options" (remove) task
Running "browserify:test" (browserify) task Bundle tests/browser/single.js created.
Running "browserify:tests" (browserify) task Error: Cannot find module './lib/chai' from '/Users/ekkis/Development/tst/tests/browser' Warning: Error running grunt-browserify. Use --force to continue.
Aborted due to warnings.
and I think the problem is that when I run 'browserify' in the 'test-web' definition, it runs 'test', in addition to 'tests' and 'libs'. so what (I think) I need is a way to run browserify:tests & libs
.
is that possible? how does everyone else deal with the fact that sometimes one wants to run just one test file?
TIA - e
figured out I can just have multiple steps: