Skip to content

Commit

Permalink
Move logic for test.only filtering to bootstrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
inikulin committed Jan 2, 2017
1 parent cea63e1 commit 3ebb00c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/compiler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ export default class Compiler {

this.esNextCompiler.cleanUpCache();

tests = flatten(tests).filter(test => !!test);

var testsWithOnlyFlag = tests.filter(test => test.only || test.fixture.only);

return testsWithOnlyFlag.length ? testsWithOnlyFlag : tests;
return flatten(tests).filter(test => !!test);
}
}
5 changes: 5 additions & 0 deletions src/runner/bootstrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ export default class Bootstrapper {
var compiler = new Compiler(this.sources);
var tests = await compiler.getTests();

var testsWithOnlyFlag = tests.filter(test => test.only || test.fixture.only);

if (testsWithOnlyFlag.length)
tests = testsWithOnlyFlag;

if (this.filter)
tests = tests.filter(test => this.filter(test.name, test.fixture.name, test.fixture.path));

Expand Down
4 changes: 3 additions & 1 deletion test/functional/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ before(function () {
})
.then(function () {
var taskReport = JSON.parse(report);
var testReport = taskReport.fixtures[0].tests[0];
var errorDescr = getTestError(taskReport, actualBrowsers);
var testReport = taskReport.fixtures.length === 1 ?
taskReport.fixtures[0].tests[0] :
taskReport;

testReport.warnings = taskReport.warnings;

Expand Down

0 comments on commit 3ebb00c

Please sign in to comment.