diff --git a/lib/index.js b/lib/index.js index 72c2b17..12aa2da 100644 --- a/lib/index.js +++ b/lib/index.js @@ -35,6 +35,8 @@ module.exports = (hermione, opts) => { return; } + console.info('hermione-test-filter: Data for tests filtering found. Specific tests will be run.'); + testCollection.disableAll(); input.forEach(({fullTitle, browserId}) => testCollection.enableTest(fullTitle, browserId)); diff --git a/test/index.js b/test/index.js index 264f2a9..09a8885 100644 --- a/test/index.js +++ b/test/index.js @@ -36,6 +36,7 @@ describe('test filter', () => { beforeEach(() => { sandbox.stub(fs, 'readFile'); sandbox.stub(console, 'warn'); + sandbox.stub(console, 'info'); }); afterEach(() => sandbox.restore()); @@ -78,5 +79,16 @@ describe('test filter', () => { assert.calledWithMatch(console.warn, 'Input file is empty. All tests will be run.'); assert.notCalled(testCollection.disableAll); }); + + it('should notice that specific tests will be run', async () => { + fs.readFile.withArgs('some/file.json').yields(null, JSON.stringify(["some tests"])); + + const hermione = mkHermioneStub({isWorker: false}); + await initHermione(hermione, {inputFile: 'some/file.json'}); + + hermione.emit(hermione.events.AFTER_TESTS_READ, mkTestCollectionStub()); + + assert.calledWithMatch(console.info, 'Data for tests filtering found. Specific tests will be run.'); + }); }); });