Skip to content

Commit 66defa5

Browse files
authored
Merge pull request #167 from tkskto/fix/change-mocha-to-jest
Fix/change mocha to jest
2 parents 594e60e + 2094529 commit 66defa5

37 files changed

+8097
-4387
lines changed

bin/analyze.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/usr/bin/env node
22

3+
import {vueComponentAnalyze} from '../dist/index.mjs';
4+
35
/**
46
* Catch and report unexpected error.
57
* @param {any} error The thrown error object.
68
* @returns {void}
79
*/
810
function onCatchError(error) {
9-
const {version} = require('../package.json');
10-
11-
console.error(`Something went wrong. component-analyzer: ${version}. follow error message.`);
11+
console.error('Something went wrong. component-analyzer. follow error message.');
1212
console.error(`${error.message}`);
1313

1414
process.exit(1);
@@ -19,7 +19,7 @@ function onCatchError(error) {
1919
process.on('unhandledRejection', onCatchError);
2020

2121
try {
22-
require('../dist/index');
22+
vueComponentAnalyze();
2323
} catch (err) {
2424
onCatchError(err);
2525
}

jest.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export default {
2+
verbose: true,
3+
globals: {
4+
'ts-jest': {
5+
useESM: true,
6+
},
7+
},
8+
preset: 'ts-jest/presets/default-esm',
9+
testMatch: [
10+
'**/test/specs/*.test.ts',
11+
],
12+
transform: {
13+
'^.+\\.ts$': 'ts-jest',
14+
},
15+
};

0 commit comments

Comments
 (0)