diff options
| author | Jez Ng | 2012-11-02 23:39:09 -0400 |
|---|---|---|
| committer | Jez Ng | 2012-11-02 23:42:37 -0400 |
| commit | 63391fb9b9cf0e13d26c4bfd90e9d5da4dd1e93b (patch) | |
| tree | 49c8c11371cad35ffd22c01914521e31e90b57a7 /Cakefile | |
| parent | 89d3c53fadfd6419c8c6e43af8ace7707deec012 (diff) | |
| download | vimium-63391fb9b9cf0e13d26c4bfd90e9d5da4dd1e93b.tar.bz2 | |
Add ability to filter tests by name.
Diffstat (limited to 'Cakefile')
| -rw-r--r-- | Cakefile | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -67,17 +67,18 @@ task "package", "build .crx file", -> crxmake.on "exit", -> fs.writeFileSync "manifest.json", origManifestText -runUnitTests = (projectDir=".") -> +runUnitTests = (projectDir=".", testNameFilter) -> console.log "Running unit tests..." basedir = path.join projectDir, "/tests/unit_tests/" test_files = fs.readdirSync(basedir).filter((filename) -> filename.indexOf("_test.js") > 0) test_files = test_files.map((filename) -> basedir + filename) test_files.forEach (file) -> require (if file[0] == '/' then '' else './') + file - Tests.run() + Tests.run(testNameFilter) return Tests.testsFailed -task "test", "run all tests", -> - unitTestsFailed = runUnitTests() +option '', '--filter-tests [string]', 'filter tests by matching string' +task "test", "run all tests", (options) -> + unitTestsFailed = runUnitTests('.', options['filter-tests']) console.log "Running DOM tests..." phantom = spawn "phantomjs", ["./tests/dom_tests/phantom_runner.js"] |
