chore: align swc usage for test:unit and fix swc/helpers hazards (#16731)

This commit is contained in:
Sébastien Vanvelthem 2023-05-18 10:53:07 +02:00 committed by GitHub
parent bdd0c462a1
commit 5d645f2103
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 72 additions and 68 deletions

View File

@ -4,7 +4,10 @@ module.exports = {
setupFilesAfterEnv: [__dirname + '/test/unit.setup.js'],
modulePathIgnorePatterns: ['.cache', 'dist'],
testPathIgnorePatterns: ['.testdata.js', '.test.utils.js'],
testMatch: ['**/__tests__/**/*.[jt]s?(x)'],
testMatch: ['**/__tests__/**/*.{js,ts,jsx,tsx}'],
transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest'],
},
// Use `jest-watch-typeahead` version 0.6.5. Newest version 1.0.0 does not support jest@26
// Reference: https://github.com/jest-community/jest-watch-typeahead/releases/tag/v1.0.0
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],

View File

@ -67,8 +67,9 @@
"@strapi/admin-test-utils": "workspace:*",
"@strapi/eslint-config": "0.1.2",
"@swc/cli": "0.1.62",
"@swc/core": "1.3.37",
"@swc/jest": "0.2.24",
"@swc/core": "1.3.58",
"@swc/helpers": "0.5.1",
"@swc/jest": "0.2.26",
"@typescript-eslint/eslint-plugin": "5.59.1",
"@typescript-eslint/parser": "5.59.1",
"babel-eslint": "10.1.0",

View File

@ -3,8 +3,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
testMatch: ['**/__tests__/**/*.test.ts'],
transform: {
'^.+\\.ts$': ['@swc/jest'],
},
displayName: 'Core data-transfer',
};

View File

@ -3,8 +3,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
testMatch: ['**/__tests__/**/*.test.ts'],
transform: {
'^.+\\.ts$': ['@swc/jest'],
},
displayName: 'Generators',
};

View File

@ -2,8 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
transform: {
'^.+\\.ts$': ['@swc/jest'],
},
displayName: 'Mailgun email provider',
};

View File

@ -2,8 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
transform: {
'^.+\\.ts$': ['@swc/jest'],
},
displayName: 'S3 upload provider',
};

View File

@ -2,8 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
transform: {
'^.+\\.ts$': ['@swc/jest'],
},
displayName: 'Local upload provider',
};

115
yarn.lock
View File

@ -8649,90 +8649,92 @@ __metadata:
languageName: node
linkType: hard
"@swc/core-darwin-arm64@npm:1.3.37":
version: 1.3.37
resolution: "@swc/core-darwin-arm64@npm:1.3.37"
"@swc/core-darwin-arm64@npm:1.3.58":
version: 1.3.58
resolution: "@swc/core-darwin-arm64@npm:1.3.58"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
"@swc/core-darwin-x64@npm:1.3.37":
version: 1.3.37
resolution: "@swc/core-darwin-x64@npm:1.3.37"
"@swc/core-darwin-x64@npm:1.3.58":
version: 1.3.58
resolution: "@swc/core-darwin-x64@npm:1.3.58"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
"@swc/core-linux-arm-gnueabihf@npm:1.3.37":
version: 1.3.37
resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.37"
"@swc/core-linux-arm-gnueabihf@npm:1.3.58":
version: 1.3.58
resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.58"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard
"@swc/core-linux-arm64-gnu@npm:1.3.37":
version: 1.3.37
resolution: "@swc/core-linux-arm64-gnu@npm:1.3.37"
"@swc/core-linux-arm64-gnu@npm:1.3.58":
version: 1.3.58
resolution: "@swc/core-linux-arm64-gnu@npm:1.3.58"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard
"@swc/core-linux-arm64-musl@npm:1.3.37":
version: 1.3.37
resolution: "@swc/core-linux-arm64-musl@npm:1.3.37"
"@swc/core-linux-arm64-musl@npm:1.3.58":
version: 1.3.58
resolution: "@swc/core-linux-arm64-musl@npm:1.3.58"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard
"@swc/core-linux-x64-gnu@npm:1.3.37":
version: 1.3.37
resolution: "@swc/core-linux-x64-gnu@npm:1.3.37"
"@swc/core-linux-x64-gnu@npm:1.3.58":
version: 1.3.58
resolution: "@swc/core-linux-x64-gnu@npm:1.3.58"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard
"@swc/core-linux-x64-musl@npm:1.3.37":
version: 1.3.37
resolution: "@swc/core-linux-x64-musl@npm:1.3.37"
"@swc/core-linux-x64-musl@npm:1.3.58":
version: 1.3.58
resolution: "@swc/core-linux-x64-musl@npm:1.3.58"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard
"@swc/core-win32-arm64-msvc@npm:1.3.37":
version: 1.3.37
resolution: "@swc/core-win32-arm64-msvc@npm:1.3.37"
"@swc/core-win32-arm64-msvc@npm:1.3.58":
version: 1.3.58
resolution: "@swc/core-win32-arm64-msvc@npm:1.3.58"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
"@swc/core-win32-ia32-msvc@npm:1.3.37":
version: 1.3.37
resolution: "@swc/core-win32-ia32-msvc@npm:1.3.37"
"@swc/core-win32-ia32-msvc@npm:1.3.58":
version: 1.3.58
resolution: "@swc/core-win32-ia32-msvc@npm:1.3.58"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard
"@swc/core-win32-x64-msvc@npm:1.3.37":
version: 1.3.37
resolution: "@swc/core-win32-x64-msvc@npm:1.3.37"
"@swc/core-win32-x64-msvc@npm:1.3.58":
version: 1.3.58
resolution: "@swc/core-win32-x64-msvc@npm:1.3.58"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
"@swc/core@npm:1.3.37":
version: 1.3.37
resolution: "@swc/core@npm:1.3.37"
"@swc/core@npm:1.3.58":
version: 1.3.58
resolution: "@swc/core@npm:1.3.58"
dependencies:
"@swc/core-darwin-arm64": 1.3.37
"@swc/core-darwin-x64": 1.3.37
"@swc/core-linux-arm-gnueabihf": 1.3.37
"@swc/core-linux-arm64-gnu": 1.3.37
"@swc/core-linux-arm64-musl": 1.3.37
"@swc/core-linux-x64-gnu": 1.3.37
"@swc/core-linux-x64-musl": 1.3.37
"@swc/core-win32-arm64-msvc": 1.3.37
"@swc/core-win32-ia32-msvc": 1.3.37
"@swc/core-win32-x64-msvc": 1.3.37
"@swc/core-darwin-arm64": 1.3.58
"@swc/core-darwin-x64": 1.3.58
"@swc/core-linux-arm-gnueabihf": 1.3.58
"@swc/core-linux-arm64-gnu": 1.3.58
"@swc/core-linux-arm64-musl": 1.3.58
"@swc/core-linux-x64-gnu": 1.3.58
"@swc/core-linux-x64-musl": 1.3.58
"@swc/core-win32-arm64-msvc": 1.3.58
"@swc/core-win32-ia32-msvc": 1.3.58
"@swc/core-win32-x64-msvc": 1.3.58
peerDependencies:
"@swc/helpers": ^0.5.0
dependenciesMeta:
"@swc/core-darwin-arm64":
optional: true
@ -8754,7 +8756,19 @@ __metadata:
optional: true
"@swc/core-win32-x64-msvc":
optional: true
checksum: 1cfa1ce8967a1d04361af076023bb50cc90bb413c347b0d7c7e86cf9b8277d05471dd2a24708a77365e527c51ddde3cd752fe49975b9e236c3abf9590e3106dd
peerDependenciesMeta:
"@swc/helpers":
optional: true
checksum: 34e5a1046aab51e55b35b966e54de8f1bcdef2535c297d76a9b0e38cba126599c24b5062c9c6ce9d4c6b5745c91e8a2eda596fe39ab27093459e8aa2934cf387
languageName: node
linkType: hard
"@swc/helpers@npm:0.5.1":
version: 0.5.1
resolution: "@swc/helpers@npm:0.5.1"
dependencies:
tslib: ^2.4.0
checksum: 71e0e27234590435e4c62b97ef5e796f88e786841a38c7116a5e27a3eafa7b9ead7cdec5249b32165902076de78446945311c973e59bddf77c1e24f33a8f272a
languageName: node
linkType: hard
@ -8767,15 +8781,15 @@ __metadata:
languageName: node
linkType: hard
"@swc/jest@npm:0.2.24":
version: 0.2.24
resolution: "@swc/jest@npm:0.2.24"
"@swc/jest@npm:0.2.26":
version: 0.2.26
resolution: "@swc/jest@npm:0.2.26"
dependencies:
"@jest/create-cache-key-function": ^27.4.2
jsonc-parser: ^3.2.0
peerDependencies:
"@swc/core": "*"
checksum: 3558213098970cc2882b1f2d1299e78ccea2e18e1e4a4c1820bb669b969ced648eacb14eb78b0bc6fe66e4a60816a7ad7a72c5048ece8382647b8ceac82b708a
checksum: 771821ed08cf168ca0b6307dee7689253d0af0685acd08408ac431860a7c42ace892db2cb6bb6dcfe297edbdce0f2e22d44ed4ed72d1c621be9e841cffd408a0
languageName: node
linkType: hard
@ -30272,8 +30286,9 @@ __metadata:
"@strapi/admin-test-utils": "workspace:*"
"@strapi/eslint-config": 0.1.2
"@swc/cli": 0.1.62
"@swc/core": 1.3.37
"@swc/jest": 0.2.24
"@swc/core": 1.3.58
"@swc/helpers": 0.5.1
"@swc/jest": 0.2.26
"@typescript-eslint/eslint-plugin": 5.59.1
"@typescript-eslint/parser": 5.59.1
babel-eslint: 10.1.0