Skip to content

Commit

Permalink
add aliasing to jest config
Browse files Browse the repository at this point in the history
  • Loading branch information
billangli committed Aug 19, 2020
1 parent 81a6985 commit a8b35d9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ module.exports = {
'^.+\\.vue$': 'vue-jest'
},
testMatch: ['**/test/**/*.test.js?(x)'],
modulePathIgnorePatterns: ["test/e2e/screenshot.test.js"] // Don't run this file in npm test
moduleNameMapper: {
'^~/(.+)$': '<rootDir>/src/$1',
},
modulePathIgnorePatterns: ['test/e2e/screenshot.test.js'] // Don't run this file in npm test
},
{
displayName: 'node',
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/test/**/*.test.node.js?(x)'],
moduleNameMapper: {
'^~/(.+)$': '<rootDir>/src/$1',
}
}
],
]
};
2 changes: 1 addition & 1 deletion test/unit/NewReleaseNotification.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { shallowMount } from '@vue/test-utils';
import NewReleaseNotification from '../../src/components/NewReleaseNotification';
import NewReleaseNotification from '~/components/NewReleaseNotification';

describe('hasNewRelease method', () => {
const wrapper = shallowMount(NewReleaseNotification, {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/classes.test.node.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const classes = require('../../src/util/classes');
const classes = require('~/util/classes');

const testClasses = [
{ name: ['Test', 'Subtest'], rule: { type: 'regex', pattern: 'test' } },
Expand Down

0 comments on commit a8b35d9

Please sign in to comment.