From abf21675d50bf879cb6dd1b15e417e73ae7aeb56 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 20 Jun 2017 15:35:01 +0100 Subject: [PATCH] Add some more logging to the tests ... to help diagnose when they fail --- test/app-tests/loading.js | 3 ++- test/test-utils.js | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/app-tests/loading.js b/test/app-tests/loading.js index b8145607..21e092e9 100644 --- a/test/app-tests/loading.js +++ b/test/app-tests/loading.js @@ -70,7 +70,8 @@ describe('loading:', function () { }); }); - afterEach(async function() { + afterEach(async function () { + console.log('loading: afterEach'); if (parentDiv) { ReactDOM.unmountComponentAtNode(parentDiv); parentDiv.remove(); diff --git a/test/test-utils.js b/test/test-utils.js index a1c1cd0a..3c697661 100644 --- a/test/test-utils.js +++ b/test/test-utils.js @@ -38,12 +38,12 @@ export function deleteIndexedDB(dbName) { const req = window.indexedDB.deleteDatabase(dbName); req.onblocked = () => { - console.log(`can't yet delete indexeddb because it is open elsewhere`); + console.log(`can't yet delete indexeddb ${dbName} because it is open elsewhere`); }; req.onerror = (ev) => { reject(new Error( - "unable to delete indexeddb: " + ev.target.error, + `unable to delete indexeddb ${dbName}: ${ev.target.error}`, )); }; @@ -51,5 +51,8 @@ export function deleteIndexedDB(dbName) { console.log(`Removed indexeddb instance: ${dbName}`); resolve(); }; + }).catch((e) => { + console.error(`Error removing indexeddb instance ${dbName}: ${e}`); + throw e; }); }