I would like to get rid of global variables in my Jest test code. Specifically describe
, it
, and expect
:
describe('Welcome (Snapshot)', () => {
it('Welcome renders hello world', () => {
// ...
});
});
So I tried to add:
import { describe, it } from 'jest';
and
import jest from 'jest';
jest.describe('Welcome (Snapshot)', () => {
jest.it('Welcome renders hello world', () => {
// ...
});
});
And other variation but it's not working.
How can I get my Jest test code working without globals?