1 | var path = require("path");
|
2 |
|
3 | // Filter by one exact relative filename match, eg:
|
4 | // --test=path/to/exact/test/filename.js
|
5 | module.exports = function(tests, filename) {
|
6 | console.log("Using mocha test filter: ", filename);
|
7 |
|
8 | var searchedForPath = path.resolve(filename);
|
9 |
|
10 | return tests.filter(function(t) {
|
11 | if (t.filename === searchedForPath) {
|
12 | return true;
|
13 | }
|
14 | });
|
15 | };
|