Skip to content

Commit

Permalink
chore: reset tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Nov 15, 2024
1 parent 5565a04 commit a758d40
Showing 1 changed file with 3 additions and 36 deletions.
39 changes: 3 additions & 36 deletions test/reverse-proxy.test.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,11 @@
import { afterEach, beforeAll, beforeEach, describe, mock } from 'bun:test'

const mockLog = {
debug: mock(),
error: mock(),
info: mock(),
}

mock.module('node:fs/promises', () => ({
mkdir: mock(),
}))

mock.module('@stacksjs/cli', () => ({
log: mockLog,
bold: mock(str => str),
dim: mock(str => str),
green: mock(str => str),
}))
import { beforeAll, describe, expect, it } from 'bun:test'

describe('@stacksjs/reverse-proxy', () => {
beforeAll(() => {
process.env.APP_ENV = 'test'
})

beforeEach(() => {
// Reset all mocks before each test
mock.restore()

// Re-mock @stacksjs/cli after restoring all mocks
mock.module('@stacksjs/cli', () => ({
log: mockLog,
bold: mock(str => str),
dim: mock(str => str),
green: mock(str => str),
}))
it('should work', async () => {
expect(true).toBe(true)
})

afterEach(() => {
// Clean up after each test
mock.restore()
})

// wip
})

0 comments on commit a758d40

Please sign in to comment.