diff --git a/package.json b/package.json index 0c5f59a2..41e56226 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ }, "jest": { "resetMocks": true, + "timers": "fake", "transform": { "^.+\\.js$": "babel-jest", ".*\\.vue$": "vue-jest" diff --git a/resources/assets/tests/components/user/Closet.test.js b/resources/assets/tests/components/user/Closet.test.js index 46aa7be7..c4813906 100644 --- a/resources/assets/tests/components/user/Closet.test.js +++ b/resources/assets/tests/components/user/Closet.test.js @@ -73,7 +73,6 @@ test('different categories', () => { }); test('search textures', () => { - jest.useFakeTimers(); Vue.prototype.$http.get.mockResolvedValue({}); const wrapper = mount(Closet); @@ -90,8 +89,6 @@ test('search textures', () => { page: 1, } ); - - jest.useRealTimers(); }); test('empty closet', () => { @@ -178,7 +175,6 @@ test('select texture', async () => { }); test('apply texture', async () => { - jest.useFakeTimers(); window.$ = jest.fn(() => ({ iCheck: () => ({ on(evt, cb) { @@ -209,8 +205,6 @@ test('apply texture', async () => { .toHaveProperty('src', '/avatar/35/10'); expect(wrapper.find('.modal-body').text()).toContain('name'); jest.runAllTimers(); - - jest.useRealTimers(); }); test('submit applying texture', async () => {