From 512b91db95ed7b9449bb948f3d2a490b3d532e71 Mon Sep 17 00:00:00 2001 From: sipayrt Date: Tue, 28 Aug 2018 21:10:20 +0300 Subject: [PATCH] feat: add info about test filtering --- lib/index.js | 2 ++ test/index.js | 12 ++++++++++++ 2 files changed, 14 insertions(+) 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.'); + }); }); });