From 0f8a21f43123f144d75f3b5986e8d099a293c82a Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Thu, 6 May 2021 04:26:41 -0700 Subject: [PATCH] Fix some unit test warnings Summary: Supress a bunch of ugly emotion warnings, which are completely irrelevant to use as they are about SSR. Also made stacktrac e a bit longer by default. Reviewed By: passy Differential Revision: D28226306 fbshipit-source-id: 9060cf2c349a265ce6b479eea252fdcfc9a6c5f2 --- desktop/package.json | 2 +- desktop/patches/@emotion+cache+11.1.3.patch | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 desktop/patches/@emotion+cache+11.1.3.patch diff --git a/desktop/package.json b/desktop/package.json index aa57d5b78..0926fa209 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -256,7 +256,7 @@ "test-with-device": "yarn build:tsc && USE_ELECTRON_STUBS=1 jest --testMatch=\"**/**.device\\.(js|jsx|ts|tsx)\" --detectOpenHandles", "test:debug": "yarn build:tsc && node --inspect node_modules/.bin/jest --runInBand", "tsc-plugins": "./ts-node scripts/tsc-plugins.ts", - "watch": "node --expose-gc ./node_modules/.bin/jest --watch" + "watch": "node --expose-gc --stack-trace-limit=40 ./node_modules/.bin/jest --watch" }, "version": "0.87.0", "workspaces": { diff --git a/desktop/patches/@emotion+cache+11.1.3.patch b/desktop/patches/@emotion+cache+11.1.3.patch new file mode 100644 index 000000000..ca0caa98b --- /dev/null +++ b/desktop/patches/@emotion+cache+11.1.3.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js b/node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js +index b25808a..043f626 100644 +--- a/node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js ++++ b/node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js +@@ -136,7 +136,7 @@ var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) { + } + + unsafePseudoClasses.forEach(function (unsafePseudoClass) { +- console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\"."); ++// we're not doing SSR and not interested in pedantic errors: console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\"."); + }); + } + };