test: add CALL util.debugAdd
gitea/salix/pipeline/pr-master This commit looks good Details

This commit is contained in:
Javier Segarra 2024-06-20 11:50:10 +00:00
parent 31a75956c0
commit bfb6689835
1 changed files with 17 additions and 0 deletions

View File

@ -61,4 +61,21 @@ describe('Renew Token', () => {
expect(error).toBeUndefined(); expect(error).toBeUndefined();
expect(response.id).toEqual(ctx.req.accessToken.id); expect(response.id).toEqual(ctx.req.accessToken.id);
}); });
it('throw error', async() => {
let error;
try {
await models.VnUser.renewToken({req: {token: null}});
} catch (e) {
error = e;
}
expect(error).toBeDefined();
const query = 'SELECT * FROM util.debug';
const debugLog = await models.Application.rawSql(query, null);
expect(debugLog.length).toEqual(1);
});
}); });