mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-10 14:25:58 +00:00
Improve error reporting on test failures a little
This commit is contained in:
parent
0ca0e60863
commit
20685c9941
@ -67,7 +67,7 @@ function assertIsAuthError(error, code, type) {
|
|||||||
|
|
||||||
function failOnError(error) {
|
function failOnError(error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
throw new Error(`Error ${error} was not expected`);
|
throw new Error(`Unexpected error in test: ${error}\n${error.stack}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ function callbackTest(requestFunc, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
||||||
testLogout() {
|
testLogout() {
|
||||||
var username = uuid();
|
var username = uuid();
|
||||||
return callbackTest((callback) => Realm.Sync.User.register('http://localhost:9080', username, 'password', callback), (error, user) => {
|
return callbackTest((callback) => Realm.Sync.User.register('http://localhost:9080', username, 'password', callback), (error, user) => {
|
||||||
@ -132,7 +132,7 @@ module.exports = {
|
|||||||
TestCase.assertUndefined(user);
|
TestCase.assertUndefined(user);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
testRegisterMissingUsername() {
|
testRegisterMissingUsername() {
|
||||||
return new Promise((resolve, _reject) => {
|
return new Promise((resolve, _reject) => {
|
||||||
@ -301,7 +301,7 @@ module.exports = {
|
|||||||
if (!isNodeProcess) {
|
if (!isNodeProcess) {
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!global.testAdminUserInfo) {
|
if (!global.testAdminUserInfo) {
|
||||||
reject("Test requires an admin user");
|
reject("Test requires an admin user");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user