bun
bun copied to clipboard
Methods beforeEach, beforeAll of bun:test is not working
Version
0.1.13
Platform
Linux WIN-KNU6MIAGFN4 5.15.57.1-microsoft-standard-WSL2 #1 SMP Wed Jul 27 02:20:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
What steps will reproduce the bug?
- Touch a file index.test.ts with next content:
import { it, describe, beforeAll, expect } from 'bun:test';
describe("check someObjct", () => {
let someObject: { use(): void };
beforeAll(() => {
someObject = { use: () => console.log('Test use function') };
});
it('should have "use" method', () => {
expect(typeof someObject.use).toBe("function");
});
});
- Run bun test
bun wiptest
How often does it reproduce? Is there a required condition?
Everytime
What is the expected behavior?
No response
What do you see instead?
Exception:
undefined is not an object (evaluating 'someObject.use')
The issue have same behaviro for beforeEach()
function
Additional information
No response
Running into this issue too, going to take a crack at it
This was fixed in #1639