Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hsjoberg committed Jun 24, 2024
1 parent a913030 commit ac3ffb2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
4 changes: 1 addition & 3 deletions jestSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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", () =>
Expand Down
5 changes: 4 additions & 1 deletion src/utils/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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][] = [];
Expand Down
5 changes: 0 additions & 5 deletions web/webpack/webpack.plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit ac3ffb2

Please sign in to comment.