Add some more logging to the tests

... to help diagnose when they fail
pull/4376/head
Richard van der Hoff 2017-06-20 15:35:01 +01:00
parent 8f8b28425d
commit abf21675d5
2 changed files with 7 additions and 3 deletions

View File

@ -70,7 +70,8 @@ describe('loading:', function () {
});
});
afterEach(async function() {
afterEach(async function () {
console.log('loading: afterEach');
if (parentDiv) {
ReactDOM.unmountComponentAtNode(parentDiv);
parentDiv.remove();

View File

@ -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;
});
}