Created
March 16, 2020 08:47
-
-
Save willi84/1869e5976fe2fcab2b226576caef5565 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var foo = 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}) | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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