This repository has been archived by the owner on Dec 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There was an unfortunate quirk of upgrading Jest. They changed their node globals to include an `ArrayBuffer` override, synchronizing the value with `Buffer.from([]).buffer.constructor`. I didn't dive too deep, but what became clear was `new Uint8Array(0).buffer` and `Buffer.from([]).buffer` reference different `ArrayBuffer` constructors. This failed the tests because I was comparing the constructor from two separate realms. See: jestjs/jest#7626 This affects production code, not just tests. Because the global constructor was different between environments, it forced me to check by string tag instead of instance. That's probably a good change anyway. I manually checked the string tag in Node, IE11, Firefox, and Chrome.
- Loading branch information
1 parent
12927c1
commit ffae625
Showing
7 changed files
with
796 additions
and
760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// This is not the same as `global.ArrayBuffer`. See: | ||
// https://github.com/facebook/jest/issues/7780 | ||
export const NativeArrayBuffer = new Uint8Array().buffer.constructor; |
Oops, something went wrong.