From 4e87b23bba85cdad670df8c19cb2324c3cf118cc Mon Sep 17 00:00:00 2001 From: Kirill Shumilov Date: Mon, 4 Sep 2017 13:25:08 +0300 Subject: [PATCH] test(xod-patch-search): fix test handling of Promise rejection in before script --- packages/xod-patch-search/test/index.spec.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/xod-patch-search/test/index.spec.js b/packages/xod-patch-search/test/index.spec.js index 6765440c..de3f7083 100644 --- a/packages/xod-patch-search/test/index.spec.js +++ b/packages/xod-patch-search/test/index.spec.js @@ -12,11 +12,14 @@ describe('xod-patch-search/index', () => { const workspace = path.resolve(__dirname, '../../../workspace'); const getProjectPath = projectName => path.resolve(workspace, projectName); - before(async () => { - const project = await loadProject(getProjectPath('welcome-to-xod')); - indexData = createIndexData(listPatches(project)); - idx = createIndex(indexData); - }); + before(() => loadProject(getProjectPath('welcome-to-xod')) + .then(listPatches) + .then(createIndexData) + .then((iData) => { + indexData = iData; + idx = createIndex(indexData); + }) + ); it('searches by path correctly', () => { const result = idx.search('path:number');