From 99ed279249a0285e9b1d51ef454e41eb45682693 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Mon, 27 Jul 2026 15:24:53 +0100 Subject: [PATCH] fix: Move jest/mock into package build (fix TS under RN 0.87) --- jest/mock.d.ts | 1 + jest/mock.js | 1 + {jest => src/jest}/mock.tsx | 4 ++-- tsconfig.json | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 jest/mock.d.ts create mode 100644 jest/mock.js rename {jest => src/jest}/mock.tsx (94%) diff --git a/jest/mock.d.ts b/jest/mock.d.ts new file mode 100644 index 00000000..58971b61 --- /dev/null +++ b/jest/mock.d.ts @@ -0,0 +1 @@ +export { default } from '../lib/typescript/src/jest/mock'; diff --git a/jest/mock.js b/jest/mock.js new file mode 100644 index 00000000..e6b3b6b9 --- /dev/null +++ b/jest/mock.js @@ -0,0 +1 @@ +module.exports = require('../lib/commonjs/jest/mock'); diff --git a/jest/mock.tsx b/src/jest/mock.tsx similarity index 94% rename from jest/mock.tsx rename to src/jest/mock.tsx index 81688c02..3bb05fa8 100644 --- a/jest/mock.tsx +++ b/src/jest/mock.tsx @@ -1,11 +1,11 @@ import { jest } from '@jest/globals'; import React, { useContext } from 'react'; -import type { Metrics } from '../src/SafeArea.types'; +import type { Metrics } from '../SafeArea.types'; import type { SafeAreaProviderProps, SafeAreaInsetsContext, SafeAreaFrameContext, -} from '../src/SafeAreaContext'; +} from '../SafeAreaContext'; const MOCK_INITIAL_METRICS: Metrics = { frame: { diff --git a/tsconfig.json b/tsconfig.json index c6163a05..27cfc5cc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "rootDir": ".", "allowJs": false, "allowUnreachableCode": false, "allowUnusedLabels": false, @@ -23,8 +24,7 @@ "include": [ "src", ".eslintrc.js", - "babel.config.js", - "jest" + "babel.config.js" ], "exclude": [ "node_modules",