From c56bdcbb610c320950ffe2e70af2aa6f9378c8e8 Mon Sep 17 00:00:00 2001 From: Roman Gafurov Date: Tue, 25 Oct 2016 15:44:10 +0300 Subject: [PATCH] fix(test): improve some tests --- package.json | 2 +- test/unit/test-reader/index.js | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a6d2ee6bd..9c4c48de9 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "fs-extra": "^0.30.0", "gemini-configparser": "^0.1.1", "gemini-coverage": "^1.0.0", - "glob-extra": "^1.3.0", + "glob-extra": "^1.3.2", "handlebars": "^4.0.5", "inherit": "~2.2.1", "install": "^0.6.1", diff --git a/test/unit/test-reader/index.js b/test/unit/test-reader/index.js index c0dacc74e..535f76841 100644 --- a/test/unit/test-reader/index.js +++ b/test/unit/test-reader/index.js @@ -198,7 +198,10 @@ describe('test-reader', () => { } }; - return assert.isRejected(readTests_({paths: ['other/path'], config}), /Cannot find files/); + globExtra.expandPaths.withArgs(['some/path']).returns(Promise.resolve(['/some/path/file1.js'])); + globExtra.expandPaths.withArgs(['other/path']).returns(Promise.resolve(['/other/path/file1.js'])); + + return assert.isRejected(readTests_({paths: ['other/path'], config}), 'Cannot find files by masks in sets'); }); describe('files of sets are specified as masks', () => { @@ -247,9 +250,10 @@ describe('test-reader', () => { } }; - globExtra.expandPaths.withArgs(['other/path']).returns(Promise.resolve(['/root/other/path/file1.js'])); + globExtra.expandPaths.withArgs(['some/path']).returns(Promise.resolve(['/some/path/file1.js'])); + globExtra.expandPaths.withArgs(['other/path']).returns(Promise.resolve(['/other/path/file1.js'])); - return assert.isRejected(readTests_({paths: ['other/path'], config}), /Cannot find files/); + return assert.isRejected(readTests_({paths: ['other/path'], config}), 'Cannot find files by masks in sets'); }); });