mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 17:45:22 +00:00
build(deps): bump jest and @types/jest (#835)
* build(deps): bump jest and @types/jest Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) and [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest). These dependencies needed to be updated together. Updates `jest` from 27.5.1 to 28.1.0 - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v28.1.0/packages/jest) Updates `@types/jest` from 27.4.1 to 28.1.0 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:production update-type: version-update:semver-major - dependency-name: "@types/jest" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix breaking changes in jest 28 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Lechner <david@pybricks.com>
This commit is contained in:
co-authored by
David Lechner
parent
e7fd76edb2
commit
09c07affa3
+8
-2
@@ -1,11 +1,11 @@
|
||||
const Environment = require('jest-environment-jsdom');
|
||||
const JSDomEnvironment = require('jest-environment-jsdom').default;
|
||||
const { TextEncoder, TextDecoder } = require('util')
|
||||
|
||||
/**
|
||||
* A custom environment to set TextEncoder/TextDecoder
|
||||
* Thanks https://stackoverflow.com/a/57713960/1976323
|
||||
*/
|
||||
module.exports = class CustomTestEnvironment extends Environment {
|
||||
module.exports = class CustomTestEnvironment extends JSDomEnvironment {
|
||||
async setup() {
|
||||
await super.setup();
|
||||
if (this.global.TextEncoder === undefined) {
|
||||
@@ -19,4 +19,10 @@ module.exports = class CustomTestEnvironment extends Environment {
|
||||
this.global.Uint8Array = Uint8Array;
|
||||
this.global.ArrayBuffer = ArrayBuffer;
|
||||
}
|
||||
|
||||
exportConditions() {
|
||||
// JSDomEnvironment returns ['browser'] but tests run in node which
|
||||
// has issues with some ESM modules.
|
||||
return ['node'];
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user