|
@@ -1,11 +1,9 @@
|
|
|
jest.mock('../..');
|
|
|
|
|
|
-document.addEventListener = jest.fn();
|
|
|
-
|
|
|
-require('./core');
|
|
|
-
|
|
|
describe('core', () => {
|
|
|
- const [event] = document.addEventListener.mock.calls[0];
|
|
|
+ beforeAll(() => {
|
|
|
+ require('./core'); // dynamic require to test side effects
|
|
|
+ });
|
|
|
|
|
|
it('exposes the Stimulus application instance for reuse', () => {
|
|
|
expect(Object.keys(window.wagtail.app)).toEqual(
|
|
@@ -25,8 +23,4 @@ describe('core', () => {
|
|
|
expect.arrayContaining(['Application', 'Controller']),
|
|
|
);
|
|
|
});
|
|
|
-
|
|
|
- it('DOMContentLoaded', () => {
|
|
|
- expect(event).toBe('DOMContentLoaded');
|
|
|
- });
|
|
|
});
|