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:
parent
f1b71f7fd7
commit
82d2228bca
2 changed files with 4 additions and 5 deletions
|
@ -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();
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue