Skip to content

Commit eba8730

Browse files
committed
Fix tests with ES Import/CommonJS require
1 parent 056be66 commit eba8730

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

tests/unit/vuedraggable.integrated.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { mount } from "@vue/test-utils";
22
import Sortable from "sortablejs";
3-
jest.genMockFromModule('sortablejs');
4-
jest.mock('sortablejs');
3+
jest.mock('sortablejs', () => ({ __esModule: true, default: jest.genMockFromModule('sortablejs') }));
54
const SortableFake = {
65
destroy: jest.fn(),
76
option: jest.fn()

tests/unit/vuedraggable.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { mount, shallowMount } from "@vue/test-utils";
22
import Sortable from "sortablejs";
3-
jest.genMockFromModule('sortablejs');
4-
jest.mock('sortablejs');
3+
jest.mock('sortablejs', () => ({ __esModule: true, default: jest.genMockFromModule('sortablejs') }));
54
const SortableFake = {
65
destroy: jest.fn(),
76
option: jest.fn()

0 commit comments

Comments
 (0)