Skip to content

Commit

Permalink
chore: warning of enzyme adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Oct 26, 2022
1 parent f5d3ba2 commit 1402d76
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@umijs/fabric": "^3.0.0",
"babel-plugin-module-resolver": "^4.1.0",
"babel-preset-umi": "^1.8.4",
"chalk": "^5.1.2",
"core-js": "^3.25.5",
"fs-extra": "^10.1.0",
"jest": "^29.2.1",
Expand Down
13 changes: 12 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import chalk from 'chalk';
import fs from 'fs-extra';
import { runCLI } from 'jest';
import path from 'path';
import fs from 'fs-extra';

const ALIAS = {
t: 'testNamePattern',
Expand All @@ -15,6 +16,16 @@ export function getConfig() {
const setupFiles = [require.resolve('./setup.js')];

if (pkg.devDependencies['enzyme']) {
if (
!pkg.dependencies['enzyme-adapter-react-16'] &&
!pkg.devDependencies['enzyme-adapter-react-16']
) {
console.log(
chalk.red(
'[rc-test] Legacy "enzyme-adapter-react-16" is not in the deps. Please install in dev deps!',
),
);
}
setupFiles.push(require.resolve('./setupEnzyme.js'));
}

Expand Down

0 comments on commit 1402d76

Please sign in to comment.