Skip to content

Commit

Permalink
dx: test data should be wiped before each test instead of after
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdjohnson committed Feb 20, 2025
1 parent ee5004a commit ad2204b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/tests/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ beforeAll(() => {
})

beforeEach(async () => {
// make sure the system setting exists
await settingTable.create({}, 'setting')
})

afterEach(async () => {
// delete all data
await localforage.dropInstance({ name: 'llm-x' })

// clear the cache on each table
DATABASE_TABLES.forEach(table => table.cache.clear())

// make sure the system setting exists
await settingTable.create({}, 'setting')
})

afterEach(async () => {
server.resetHandlers()
})

Expand Down

0 comments on commit ad2204b

Please sign in to comment.