Revert "fix: eslint去掉files"

This reverts commit 1e9c8e295257783e132c118ae0c8bf195b3b51b0.
This commit is contained in:
万纯 2021-02-02 12:06:15 +08:00
parent 1e9c8e2952
commit c49b3ca3aa
3 changed files with 7 additions and 3 deletions

View File

@ -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';

View File

@ -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
}

View File

@ -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);