diff --git a/packages/fes-plugin-unit-jest/src/index.js b/packages/fes-plugin-unit-jest/src/index.js index e5b80b8d..27d79816 100644 --- a/packages/fes-plugin-unit-jest/src/index.js +++ b/packages/fes-plugin-unit-jest/src/index.js @@ -6,7 +6,7 @@ import { Logger } from '@webank/fes-compiler'; import { options as CliOptions } from 'jest-cli/build/cli/args'; import createDefaultConfig from './createDefaultConfig'; -const logger = new Logger('fes:plugin-unit-jest'); +const logger = new Logger('fes:plugin-built-in'); export default function (api) { const { utils: { mergeConfig }, cwd } = api; @@ -16,7 +16,7 @@ export default function (api) { description: 'run unit tests with jest', options: { '--watch': 'run tests in watch mode', - '--debug': 'print debug logs' + '--debug': 'debug' }, async fn({ args }) { process.env.NODE_ENV = 'test'; diff --git a/packages/fes-template/.eslintrc.js b/packages/fes-template/.eslintrc.js index 7d04898c..57c7f909 100644 --- a/packages/fes-template/.eslintrc.js +++ b/packages/fes-template/.eslintrc.js @@ -1,5 +1,9 @@ module.exports = { extends: [require.resolve('@webank/eslint-config-webank')], + files: [ + '**/__tests__/*.{j,t}s?(x)', + '**/tests/unit/**/*.spec.{j,t}s?(x)' + ], env: { jest: true } diff --git a/packages/fes-template/__tests__/add.js b/packages/fes-template/__tests__/add.js index d5c874a0..5eaa2245 100644 --- a/packages/fes-template/__tests__/add.js +++ b/packages/fes-template/__tests__/add.js @@ -1,4 +1,4 @@ -import sum from '@/utils/sum'; +import sum from "@/utils/sum" test('adds 1 + 2 to equal 3', () => { expect(sum(1, 2)).toBe(3);