Change module mapping

This commit is contained in:
Pig Fang 2018-07-31 10:42:14 +08:00
parent 21dfb21c41
commit 7ab91a568d
3 changed files with 7 additions and 6 deletions

View File

@ -91,12 +91,13 @@
"node" "node"
], ],
"moduleNameMapper": { "moduleNameMapper": {
"^@/(.*)$": "<rootDir>/resources/assets/src/components/$1" "^@/(.*)$": "<rootDir>/resources/assets/src/$1"
}, },
"setupTestFrameworkScriptFile": "<rootDir>/resources/assets/tests/setup.js", "setupTestFrameworkScriptFile": "<rootDir>/resources/assets/tests/setup.js",
"coveragePathIgnorePatterns": [ "coveragePathIgnorePatterns": [
"/node_modules/", "/node_modules/",
"setup" "setup",
"assets/src/js"
], ],
"testRegex": "resources/assets/tests/.*\\.(spec|test)\\.js" "testRegex": "resources/assets/tests/.*\\.(spec|test)\\.js"
} }

View File

@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Previewer from '@/common/Previewer'; import Previewer from '@/components/common/Previewer';
import * as mockedSkinview3d from '../../__mocks__/skinview3d'; import * as mockedSkinview3d from '../../__mocks__/skinview3d';
import '../../../src/images/textures/steve.png'; import '../../../src/images/textures/steve.png';

View File

@ -1,10 +1,10 @@
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import ClosetItem from '@/user/ClosetItem'; import ClosetItem from '@/components/user/ClosetItem';
import axios from 'axios'; import axios from 'axios';
import { swal } from '@/../js/notify'; import { swal } from '@/js/notify';
jest.mock('axios'); jest.mock('axios');
jest.mock('@/../js/notify'); jest.mock('@/js/notify');
function factory(opt = {}) { function factory(opt = {}) {
return { return {