Skip to content

Commit 5c6c594

Browse files
committed
Remove enzyme commands
1 parent e413267 commit 5c6c594

File tree

14 files changed

+86
-374
lines changed

14 files changed

+86
-374
lines changed

packages/generator-widget/generators/app/templates/packages/__tests__/outputs/package_web.json-js-unit-e2e.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"build": "pluggable-widgets-tools build:web",
2222
"lint": "pluggable-widgets-tools lint",
2323
"lint:fix": "pluggable-widgets-tools lint:fix",
24-
"test": "pluggable-widgets-tools test:unit:web:enzyme-free && npm run test:e2e",
25-
"test:unit": "pluggable-widgets-tools test:unit:web:enzyme-free",
24+
"test": "pluggable-widgets-tools test:unit:web && npm run test:e2e",
25+
"test:unit": "pluggable-widgets-tools test:unit:web",
2626
"test:e2e": "npx cypress open --browser chrome --e2e",
2727
"prerelease": "npm run lint",
2828
"release": "pluggable-widgets-tools release:web"

packages/generator-widget/generators/app/templates/packages/__tests__/outputs/package_web.json-js-unit.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"build": "pluggable-widgets-tools build:web",
2222
"lint": "pluggable-widgets-tools lint",
2323
"lint:fix": "pluggable-widgets-tools lint:fix",
24-
"test": "pluggable-widgets-tools test:unit:web:enzyme-free",
25-
"test:unit": "pluggable-widgets-tools test:unit:web:enzyme-free",
24+
"test": "pluggable-widgets-tools test:unit:web",
25+
"test:unit": "pluggable-widgets-tools test:unit:web",
2626
"prerelease": "npm run lint",
2727
"release": "pluggable-widgets-tools release:web"
2828
},

packages/generator-widget/generators/app/templates/packages/__tests__/outputs/package_web.json-ts-unit-e2e.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"build": "pluggable-widgets-tools build:web",
2222
"lint": "pluggable-widgets-tools lint",
2323
"lint:fix": "pluggable-widgets-tools lint:fix",
24-
"test": "pluggable-widgets-tools test:unit:web:enzyme-free && npm run test:e2e",
25-
"test:unit": "pluggable-widgets-tools test:unit:web:enzyme-free",
24+
"test": "pluggable-widgets-tools test:unit:web && npm run test:e2e",
25+
"test:unit": "pluggable-widgets-tools test:unit:web",
2626
"test:e2e": "npx cypress open --browser chrome --e2e",
2727
"prerelease": "npm run lint",
2828
"release": "pluggable-widgets-tools release:web"

packages/generator-widget/generators/app/templates/packages/__tests__/outputs/package_web.json-ts-unit.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"build": "pluggable-widgets-tools build:web",
2222
"lint": "pluggable-widgets-tools lint",
2323
"lint:fix": "pluggable-widgets-tools lint:fix",
24-
"test": "pluggable-widgets-tools test:unit:web:enzyme-free",
25-
"test:unit": "pluggable-widgets-tools test:unit:web:enzyme-free",
24+
"test": "pluggable-widgets-tools test:unit:web",
25+
"test:unit": "pluggable-widgets-tools test:unit:web",
2626
"prerelease": "npm run lint",
2727
"release": "pluggable-widgets-tools release:web"
2828
},

packages/generator-widget/generators/app/templates/packages/package_web.json.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"build": "pluggable-widgets-tools build:web",
2222
"lint": "pluggable-widgets-tools lint",
2323
"lint:fix": "pluggable-widgets-tools lint:fix",<% if (hasUnitTests) { %>
24-
"test": "pluggable-widgets-tools test:unit:web:enzyme-free<% if (hasE2eTests) { %> && npm run test:e2e<% } %>",
25-
"test:unit": "pluggable-widgets-tools test:unit:web:enzyme-free",<% } %><% if (hasE2eTests) { %>
24+
"test": "pluggable-widgets-tools test:unit:web<% if (hasE2eTests) { %> && npm run test:e2e<% } %>",
25+
"test:unit": "pluggable-widgets-tools test:unit:web",<% } %><% if (hasE2eTests) { %>
2626
"test:e2e": "npx cypress open --browser chrome --e2e",<% } %>
2727
"prerelease": "npm run lint",
2828
"release": "pluggable-widgets-tools release:web"

packages/pluggable-widgets-tools/bin/mx-scripts.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const { execSync, spawnSync } = require("child_process");
33
const { existsSync } = require("fs");
44
const { delimiter, dirname, join, parse } = require("path");
55
const { checkMigration } = require("../utils/migration");
6+
const { checkForEnzymeUsage } = require("../utils/enzyme-detector");
67
const { red } = require("ansi-colors");
78

89
checkNodeVersion();
@@ -21,6 +22,11 @@ checkNodeVersion();
2122
if (args.indexOf("--subprojectPath") > -1) {
2223
args.splice(args.indexOf("--subprojectPath"), 2);
2324
}
25+
26+
if (cmd && cmd.startsWith("test:unit")) {
27+
checkForEnzymeUsage();
28+
}
29+
2430
const realCommand = getRealCommand(cmd, toolsRoot) + " " + args.join(" ");
2531
console.log(`Running MX Widgets Tools script ${cmd}...`);
2632

@@ -90,8 +96,6 @@ function getRealCommand(cmd, toolsRoot) {
9096
return `jest --projects "${join(toolsRoot, "test-config/jest.config.js")}"`;
9197
case "test:unit:native":
9298
return `jest --projects "${join(toolsRoot, "test-config/jest.native.config.js")}"`;
93-
case "test:unit:web:enzyme-free":
94-
return `jest --projects "${join(toolsRoot, "test-config/jest.enzyme-free.config.js")}"`;
9599
case "test:e2e":
96100
case "test:e2e:ts":
97101
case "test:e2e:web:cypress":

packages/pluggable-widgets-tools/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"@babel/preset-env": "^7.26.0",
3333
"@babel/preset-react": "^7.25.9",
3434
"@react-native/babel-preset": "0.77.3",
35-
"@cfaester/enzyme-adapter-react-18": "^0.6.0",
3635
"@prettier/plugin-xml": "^1.2.0",
3736
"@rollup/plugin-alias": "^5.1.1",
3837
"@rollup/plugin-babel": "^6.0.4",
@@ -61,8 +60,6 @@
6160
"concurrently": "^6.0.0",
6261
"core-js": "^3.6.5",
6362
"dotenv": "^8.2.0",
64-
"enzyme": "^3.11.0",
65-
"enzyme-to-json": "^3.6.1",
6663
"eslint": "^7.20.0",
6764
"eslint-config-prettier": "^8.0.0",
6865
"eslint-plugin-jest": "^24.1.5",
@@ -80,7 +77,6 @@
8077
"jest-environment-jsdom": "^29.4.1",
8178
"jest-jasmine2": "^29.0.3",
8279
"jest-junit": "^13.0.0",
83-
"jest-react-hooks-shallow": "^1.5.1",
8480
"make-dir": "^3.1.0",
8581
"mendix": "^10.21.64362",
8682
"mime": "^3.0.0",

packages/pluggable-widgets-tools/test-config/jest.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ module.exports = {
77
testRunner: "jest-jasmine2",
88
rootDir: join(projectDir, "src"),
99
setupFilesAfterEnv: [join(__dirname, "test-index.js")],
10-
snapshotSerializers: ["enzyme-to-json/serializer"],
1110
testMatch: ["<rootDir>/**/*.spec.{js,jsx,ts,tsx}"],
1211
transform: {
1312
"^.+\\.tsx?$": [

packages/pluggable-widgets-tools/test-config/jest.enzyme-free.config.js

Lines changed: 0 additions & 32 deletions
This file was deleted.

packages/pluggable-widgets-tools/test-config/test-index-native.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const { TextEncoder, TextDecoder } = require("util");
2-
const enableHooks = require("jest-react-hooks-shallow").default;
32

43
Object.defineProperties(global, {
54
TextEncoder: {
@@ -10,7 +9,6 @@ Object.defineProperties(global, {
109
}
1110
});
1211

13-
enableHooks(jest);
1412
global.setImmediate = global.setTimeout;
1513

1614
const origConsole = console.error;

0 commit comments

Comments
 (0)