We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bun test
Leaks across files.
Example:
// data.ts export const data = { name: 'User', }
// test1.test.ts import { expect, test } from 'bun:test' import { data } from './data' data.name = 'Admin' test('test-1', () => { expect(data).toEqual({ name: 'Admin', }) })
// test2.test.ts import { expect, test } from 'bun:test' import { data } from './data' test('test-2', () => { expect(data).toEqual({ name: 'User', }) })
test2 will fail because the data has been modified in test1.
bun test v1.0.3 (25e69c71) test/test1.test.ts: ✓ test-1 [0.08ms] test/test2.test.ts: 1 | import { expect, test } from 'bun:test' 2 | import { data } from './data' 3 | 4 | test('test-2', () => { 5 | expect(data).toEqual({ ^ error: expect(received).toEqual(expected) { + name: "Admin" - name: "User" } - Expected - 1 + Received + 1
In vitest and jest, both tests pass.
Isolated by default, but can be disabled using a parameter. Ref: https://vitest.dev/config/#isolate
No response
The text was updated successfully, but these errors were encountered:
I think this is important for production
Sorry, something went wrong.
No branches or pull requests
What is the problem this feature would solve?
Leaks across files.
Example:
test2 will fail because the data has been modified in test1.
In vitest and jest, both tests pass.
What is the feature you are proposing to solve the problem?
Isolated by default, but can be disabled using a parameter.
Ref: https://vitest.dev/config/#isolate
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: