Skip to content

Commit 20c2767

Browse files
committed
fix: testing setup
1 parent d713847 commit 20c2767

File tree

5 files changed

+21
-26
lines changed

5 files changed

+21
-26
lines changed

examples/rn-app/jest.config.js

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

jest.config.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
import type { Config } from 'jest';
1+
import path from 'path';
2+
import { type JestConfigWithTsJest, createDefaultPreset } from 'ts-jest';
3+
import { fileURLToPath } from 'url';
24

3-
const config: Config = {
4-
preset: 'react-native',
5-
modulePathIgnorePatterns: ['*/node_modules', '*/lib/'],
5+
const basePreset = createDefaultPreset({
6+
tsconfig: path.resolve(
7+
path.dirname(fileURLToPath(import.meta.url)),
8+
'tsconfig.test.json'
9+
),
10+
});
11+
12+
const config: JestConfigWithTsJest = {
13+
...basePreset,
614
};
715

816
export default config;

packages/instrumentation-react/jest.config.ts

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

packages/instrumentation-react/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"build": "pnpm run typescript",
2323
"build:watch": "tsc --watch",
2424
"dev": "concurrently \"pnpm run build:watch\" \"pnpm run test:watch\"",
25-
"test": "jest",
26-
"test:watch": "jest --watch",
27-
"test:update-snapshots": "jest --updateSnapshot",
25+
"test": "jest --config ../../jest.config.ts",
26+
"test:watch": "jest --watch --config ../../jest.config.ts",
27+
"test:update-snapshots": "jest --updateSnapshot --config ../../jest.config.ts",
2828
"release": "release-it"
2929
},
3030
"keywords": [

tsconfig.test.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"verbatimModuleSyntax": false
5+
}
6+
}

0 commit comments

Comments
 (0)