Skip to content
Snippets Groups Projects
Unverified Commit 0eb62a09 authored by Matiss Janis Aboltins's avatar Matiss Janis Aboltins Committed by GitHub
Browse files

:wrench: improve unit test stability while using uuid (#3144)

parent 73d52fa0
No related branches found
No related tags found
No related merge requests found
...@@ -58,6 +58,17 @@ jest.mock('uuid', () => ({ ...@@ -58,6 +58,17 @@ jest.mock('uuid', () => ({
return 'id' + _id++; return 'id' + _id++;
}, },
})); }));
jest.mock('../server/migrate/migrations', () => {
const realMigrations = jest.requireActual('../server/migrate/migrations');
return {
...realMigrations,
migrate: async db => {
_id = 100_000_000;
await realMigrations.migrate(db);
_id = 1;
},
};
});
global.getDatabaseDump = async function (tables) { global.getDatabaseDump = async function (tables) {
if (!tables) { if (!tables) {
......
---
category: Maintenance
authors: [MatissJanis]
---
Unit tests: improve the reliability of unique ids.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment