From 7898d72798c7d496c208b570f9564262d3cf0776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez=20Jim=C3=A9nez?= Date: Sat, 18 Sep 2021 02:10:21 +0200 Subject: [PATCH] test: use cjs config on esm config --- jest.config.esm.ts | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/jest.config.esm.ts b/jest.config.esm.ts index 2d5fdbc..7e463ce 100644 --- a/jest.config.esm.ts +++ b/jest.config.esm.ts @@ -1,27 +1,8 @@ -import type { Config } from '@jest/types' +import config from './jest.config.cjs' -// see https://jestjs.io/docs/ecmascript-modules - -// Sync object -const config: Config.InitialOptions = { - verbose: true, - testMatch: [ - '**/__tests__/**/*.+(ts|tsx|js)', - '**/?(*.)+(spec|test).+(ts|tsx|js)', - ], - moduleDirectories: [ - 'node_modules', - 'src', - ], - moduleFileExtensions: ['ts', 'js'], - extensionsToTreatAsEsm: ['.ts'], - transform: { - '^.+\\.ts$': 'ts-jest', - }, - globals: { - 'ts-jest': { - useESM: true, - }, +config.globals = { + 'ts-jest': { + useESM: true, }, }