Skip to content

Commit

Permalink
buffer setprototype
Browse files Browse the repository at this point in the history
  • Loading branch information
Wozacosta committed Oct 24, 2024
1 parent 0753ec1 commit 1a4bd47
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions libs/ledger-live-common/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,26 @@ if (process.env.CI) {
// interface Uint8ArrayAlloc extends Uint8Array {
// alloc(size: number): Uint8Array;
// }
class U8a extends Uint8Array {
alloc(size: number) {
return new Uint8Array(size);
}
}

// class U8a extends Uint8Array {
// alloc(size: number) {
// return new Uint8Array(size);
// }
// }
// Object.defineProperty(Uint8Array, "alloc", {
// writable: false,
// value: function (size: number) {
// return new Uint8Array(size);
// },
// });
Object.setPrototypeOf(Buffer, Uint8Array);

const defaultConfig = {
preset: "ts-jest",
globals: {
"ts-jest": {
isolatedModules: true,
},
Buffer: U8a,
// Buffer: U8a,
},
testEnvironment: "node",
reporters,
Expand Down

0 comments on commit 1a4bd47

Please sign in to comment.