Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up some log outputs from the integ tests #4376

Merged
merged 1 commit into from
Jun 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/app-tests/loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('loading:', function () {
});

afterEach(async function () {
console.log('loading: afterEach');
console.log(`${Date.now()}: loading: afterEach`);
if (parentDiv) {
ReactDOM.unmountComponentAtNode(parentDiv);
parentDiv.remove();
Expand All @@ -84,6 +84,7 @@ describe('loading:', function () {
// clear the indexeddbs so we can start from a clean slate next time.
await test_utils.deleteIndexedDB('matrix-js-sdk:crypto');
await test_utils.deleteIndexedDB('matrix-js-sdk:riot-web-sync');
console.log(`${Date.now()}: loading: afterEach complete`);
});

/* simulate the load process done by index.js
Expand Down Expand Up @@ -615,7 +616,6 @@ describe('loading:', function () {
matrixChat, sdk.getComponent('structures.login.Login'));

httpBackend.when('POST', '/login').check(function(req) {
console.log(req);
expect(req.data.type).toEqual('m.login.password');
expect(req.data.identifier.type).toEqual('m.id.user');
expect(req.data.identifier.user).toEqual('user');
Expand Down
10 changes: 5 additions & 5 deletions test/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@ export function deleteIndexedDB(dbName) {
return;
}

console.log(`Removing indexeddb instance: ${dbName}`);
console.log(`${Date.now()}: Removing indexeddb instance: ${dbName}`);
const req = window.indexedDB.deleteDatabase(dbName);

req.onblocked = () => {
console.log(`can't yet delete indexeddb ${dbName} because it is open elsewhere`);
console.log(`${Date.now()}: can't yet delete indexeddb ${dbName} because it is open elsewhere`);
};

req.onerror = (ev) => {
reject(new Error(
`unable to delete indexeddb ${dbName}: ${ev.target.error}`,
`${Date.now()}: unable to delete indexeddb ${dbName}: ${ev.target.error}`,
));
};

req.onsuccess = () => {
console.log(`Removed indexeddb instance: ${dbName}`);
console.log(`${Date.now()}: Removed indexeddb instance: ${dbName}`);
resolve();
};
}).catch((e) => {
console.error(`Error removing indexeddb instance ${dbName}: ${e}`);
console.error(`${Date.now()}: Error removing indexeddb instance ${dbName}: ${e}`);
throw e;
});
}