1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix error with jose package upgrade

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-07-05 14:52:00 -04:00
parent 8ba7d8427a
commit c843d1b7bd
2 changed files with 10 additions and 3 deletions

View File

@ -21,9 +21,12 @@ module.exports = (path, options) => {
// Once we're able to migrate our Jest config to ESM and a browser crypto
// implementation is available for the browser+ESM version of uuid to use (eg, via
// https://github.com/jsdom/jsdom/pull/3352 or a similar polyfill), this can go away.
if (pkg.name === "uuid") {
delete pkg["exports"];
delete pkg["module"];
switch (pkg.name) {
case "uuid":
case "jose":
delete pkg["exports"];
delete pkg["module"];
break;
}
return pkg;

View File

@ -7,6 +7,7 @@ import fetchMock from "jest-fetch-mock";
import configurePackages from "./common/configure-packages";
import { configure } from "mobx";
import { setImmediate } from "timers";
import { TextEncoder, TextDecoder as TextDecoderNode } from "util";
// setup default configuration for external npm-packages
configurePackages();
@ -32,3 +33,6 @@ global.fail = ((error = "Test failed without explicit error") => {
process.on("unhandledRejection", (err: any) => {
global.fail(err);
});
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoderNode as unknown as typeof TextDecoder;