0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Added db reset to new e2e framework

- Ensure that the DB is always reset between tests
- We assume that the DB will be torn down and rebuilt between tests
- Without this, previous tests clobber the current tests, and it's not possible to tell when running files in isolation
which makes developing really tricky
This commit is contained in:
Hannah Wolfe 2022-02-07 15:43:25 +00:00
parent f1b71f7fd7
commit 82d2228bca
No known key found for this signature in database
GPG key ID: AB586C3B5AE5C037
2 changed files with 4 additions and 5 deletions

View file

@ -20,10 +20,6 @@ describe('Authentication API canary', function () {
agent = await framework.getAgent('/ghost/api/canary/admin/');
});
after(async function () {
await framework.resetDb();
});
beforeEach(function () {
emailStub = framework.stubMail();
});

View file

@ -45,6 +45,9 @@ const startGhost = async () => {
server: false
};
// Ensure the DB state
await resetDb();
return boot(defaults);
};
@ -105,7 +108,7 @@ const getFixture = (type, index = 0) => {
};
const resetDb = async () => {
await db.teardown();
await db.reset();
};
/**