From 2b2499107f5e0079ef262c247f302fb29b42d66c Mon Sep 17 00:00:00 2001 From: "Hung-Han (Henry) Chen" Date: Fri, 30 Oct 2020 14:46:15 +0800 Subject: [PATCH] Mock from @lingui/macro as a component simplely returns children components Signed-off-by: Hung-Han (Henry) Chen Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com> --- __mocks__/@linguiMacro.ts | 3 +++ package.json | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 __mocks__/@linguiMacro.ts diff --git a/__mocks__/@linguiMacro.ts b/__mocks__/@linguiMacro.ts new file mode 100644 index 0000000000..5a0c157331 --- /dev/null +++ b/__mocks__/@linguiMacro.ts @@ -0,0 +1,3 @@ +module.exports = { + Trans: ({ children }: { children: React.ReactNode }) => children, +}; diff --git a/package.json b/package.json index 2cc43e4c76..727125cb2a 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,8 @@ "^.+\\.tsx?$": "ts-jest" }, "moduleNameMapper": { - "\\.(css|scss)$": "/__mocks__/styleMock.ts" + "\\.(css|scss)$": "/__mocks__/styleMock.ts", + "^@lingui/macro$": "/__mocks__/@linguiMacro.ts" }, "modulePathIgnorePatterns": [ "/dist"