Fix emotion cache output garbage in unit tests

Summary:
emotion/cache started generating nonsense warnings about SSR again when running unit tests. This is because atm emotion/cache is 3(!) times in our dep tree, and the wrong one got patched. Tried to dedupe that, but it seems inevitable:

- emotion/react requires v. 11.6.0 of it
- emotion/css requires v. 11.5.0 because a newer version of that package hasn't been released
- console-feed still uses emotion 10.

So instead, just added an other patch

Reviewed By: passy

Differential Revision: D32557413

fbshipit-source-id: 8a61a8065d21123453b3345b25ff87a9865094ed
This commit is contained in:
Michel Weststrate
2021-11-19 03:59:55 -08:00
committed by Facebook GitHub Bot
parent 3e9cf79dff
commit 35c482ac92
3 changed files with 22 additions and 4 deletions

View File

@@ -0,0 +1,18 @@
diff --git a/node_modules/@emotion/react/node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js b/node_modules/@emotion/react/node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js
index b1ad6ac..e577f28 100644
--- a/node_modules/@emotion/react/node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js
+++ b/node_modules/@emotion/react/node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js
@@ -158,9 +158,10 @@ var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
return;
}
- 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\".");
- });
+ // messes up unit tests, and we don't do SSR!
+ // 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\".");
+ // });
}
};
};