Skip to content

Instantly share code, notes, and snippets.

@willi84
Created March 16, 2020 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willi84/1869e5976fe2fcab2b226576caef5565 to your computer and use it in GitHub Desktop.
Save willi84/1869e5976fe2fcab2b226576caef5565 to your computer and use it in GitHub Desktop.
var foo = 3;
jest
.dontMock('jquery');
var $ = require('jquery');
describe('MyModule', () => {
beforeEach(() => {
jest.resetModules()
});
describe('test', function() {
it('testing simple variable', function() {
require('bar')
expect(foo).toEqual(3);
})
})
})
global.jQuery = require('jquery');
global.$ = global.jQuery;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment