Updated test
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2022-05-13 10:59:13 +02:00
parent 649be482b5
commit 4479337731
2 changed files with 6 additions and 4 deletions

2
Jenkinsfile vendored
View File

@ -122,7 +122,7 @@ pipeline {
if (!['master', 'test'].contains(env.BRANCH_NAME)) {
try {
// junit 'junitresults.xml'
junit 'junit.xml'
// junit 'junit.xml'
} catch (e) {
echo e.toString()
}

View File

@ -2,9 +2,11 @@ const {models} = require('vn-loopback/server/server');
fdescribe('account changePassword()', () => {
it('should throw an error when old password is wrong', async() => {
const response = models.Account.changePassword(1, 'wrongPassword', 'nightmare.9999');
let err;
await models.Account.changePassword(1, 'wrongPassword', 'nightmare.9999')
.catch(error => err = error.sqlMessage);
const error = new Error('ER_SIGNAL_EXCEPTION: Invalid password');
await expectAsync(response).toBeRejectedWith(error);
expect(err).toBeDefined();
expect(err).toEqual('Invalid password');
});
});