diff --git a/jest.config.js b/jest.config.js index 2a3739377..f069ae947 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,7 +2,7 @@ module.exports = { preset: "react-native", moduleFileExtensions: ["android.ts", "android.tsx", "ts", "tsx", "js", "jsx", "json", "node"], transformIgnorePatterns: [ - "node_modules/(?!react-native|@shoutem|react-clone-referenced-element|native-base|native-base-shoutem-theme|react-native-camera|@react-navigation|react-navigation-tabs|react-navigation|@react-native-community/async-storage|@react-native-community/slider|@codler/react-native-keyboard-aware-scroll-view|@react-native-community/picker|@react-native)", + "node_modules/(?!react-native|@shoutem|react-clone-referenced-element|native-base|native-base-shoutem-theme|react-native-camera|@react-navigation|react-navigation-tabs|react-navigation|@react-native-community/async-storage|@react-native-community/slider|@codler/react-native-keyboard-aware-scroll-view|@react-native-community/picker|@react-native|@notifee/react-native)", ], testPathIgnorePatterns: ["tests/utils.ts"], setupFiles: [ diff --git a/jestSetup.js b/jestSetup.js index 5b969bf31..3cf1e3502 100644 --- a/jestSetup.js +++ b/jestSetup.js @@ -4,9 +4,7 @@ jest.mock("@react-native-async-storage/async-storage", () => ); jest.mock("react-native-sqlite-storage", () => require("./mocks/react-native-sqlite-storage")); jest.mock("react-native-build-config", () => require("./mocks/react-native-build-config")); -jest.mock("react-native-push-notification", () => - require("./mocks/react-native-push-notification"), -); +jest.mock("@notifee/react-native", () => require("@notifee/react-native/jest-mock")); jest.mock("react-native-keychain", () => require("./mocks/react-native-keychain")); jest.mock("react-native-securerandom", () => require("./mocks/react-native-securerandom")); jest.mock("react-native-fingerprint-scanner", () => diff --git a/src/utils/log.ts b/src/utils/log.ts index b23b8d13c..4bd01dc99 100644 --- a/src/utils/log.ts +++ b/src/utils/log.ts @@ -3,7 +3,10 @@ import { NativeModules } from "react-native"; import { Debug } from "./build"; import { PLATFORM } from "./constants"; -const isNativePlatform = ["android", "ios", "macos"].includes(PLATFORM); +const isNativePlatform = + ["android", "ios", "macos"].includes(PLATFORM) && !window?.process?.env?.JEST_WORKER_ID; + +console.log("!window?.process?.env?.JEST_WORKER_ID", window?.process?.env?.JEST_WORKER_ID); export type LogLevel = "Verbose" | "Debug" | "Info" | "Warning" | "Error"; export const logEntries: [LogLevel, string][] = []; diff --git a/web/webpack/webpack.plugins.js b/web/webpack/webpack.plugins.js index 6fa8dbc23..63e46cad9 100644 --- a/web/webpack/webpack.plugins.js +++ b/web/webpack/webpack.plugins.js @@ -60,11 +60,6 @@ module.exports = [ path.join(__dirname, "../web-hacks/react-native-permission.js") ), - new webpack.NormalModuleReplacementPlugin( - /node_modules\/react-native-push-notification/, - path.join(__dirname, "../web-hacks/react-native-push-notification.js") - ), - new webpack.NormalModuleReplacementPlugin( /node_modules\/react-native-sqlite-storage/, path.join(__dirname, "../web-hacks/react-native-sqlite-storage.js")