chore: move to swc/jest (#7739)

* chore: move to swc

* chore: fix tax rate tests

* chore: undo failed test

* chore: fix unit tests script

* chore: use node 20

* Update scripts/run-workspace-unit-tests-in-chunks.sh
This commit is contained in:
Riqwan Thamir
2024-06-20 12:59:33 +02:00
committed by GitHub
parent f61557712c
commit 03924a4ff6
137 changed files with 386 additions and 419 deletions
+1 -9
View File
@@ -1,13 +1,5 @@
module.exports = {
transform: {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsconfig: "tsconfig.json",
isolatedModules: true,
},
],
},
transform: { "^.+\\.[jt]s?$": "@swc/jest" },
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
}
-1
View File
@@ -24,7 +24,6 @@
"cross-env": "^5.2.1",
"jest": "^29.7.0",
"rimraf": "^5.0.1",
"ts-jest": "^29.1.1",
"typescript": "^5.1.6"
},
"dependencies": {
@@ -84,7 +84,7 @@ export type RegisterModuleJoinerConfig =
| ModuleJoinerConfig
| ((modules: ModuleJoinerConfig[]) => ModuleJoinerConfig)
export class MedusaModule {
class MedusaModule {
private static instances_: Map<string, { [key: string]: IModuleService }> =
new Map()
private static modules_: Map<string, ModuleAlias[]> = new Map()
@@ -589,4 +589,6 @@ export class MedusaModule {
}
global.MedusaModule ??= MedusaModule
exports.MedusaModule = global.MedusaModule
const GlobalMedusaModule = global.MedusaModule as typeof MedusaModule
export { GlobalMedusaModule as MedusaModule }
+1 -1
View File
@@ -63,7 +63,7 @@ export class RemoteLink {
)
}
for (const mod of modulesLoaded) {
for (const mod of modulesLoaded || []) {
this.addModule(mod)
}
}
@@ -39,7 +39,7 @@ export class RemoteQuery {
)
}
for (const mod of modulesLoaded) {
for (const mod of modulesLoaded || []) {
if (!mod.__definition.isQueryable) {
continue
}