mirror of
https://github.com/withastro/astro.git
synced 2025-02-24 22:46:02 -05:00
refactor: beforeEach to isolate dev servers
This commit is contained in:
parent
b6ce9894c1
commit
483fbd13fc
1 changed files with 8 additions and 2 deletions
|
@ -16,12 +16,18 @@ describe('astro:db', () => {
|
|||
describe('development', () => {
|
||||
let devServer;
|
||||
|
||||
before(async () => {
|
||||
// Note(bholmesdev): Using before() caused a race condition
|
||||
// of parallel tests trying to seed at the same time.
|
||||
// This does not occur locally, but appears in the test runner
|
||||
// as the `astro:db` module is re-evaluated for each test.
|
||||
// Still unsure why this occurs!
|
||||
// Use beforeEach() to avoid clobbering.
|
||||
beforeEach(async () => {
|
||||
console.log('starting dev server');
|
||||
devServer = await fixture.startDevServer();
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
afterEach(async () => {
|
||||
await devServer.stop();
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue