From 869a06884e685b66e72f528a82f536436095ee98 Mon Sep 17 00:00:00 2001 From: Samy RABAH-MONTAROU Date: Thu, 12 Dec 2024 13:31:05 +0100 Subject: [PATCH] polyfill only within celo test --- libs/ledger-live-common/jest.config.ts | 2 -- libs/ledger-live-common/jest.polyfills.js | 5 ----- .../src/families/celo/bridge.integration.test.ts | 6 ++++++ 3 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 libs/ledger-live-common/jest.polyfills.js diff --git a/libs/ledger-live-common/jest.config.ts b/libs/ledger-live-common/jest.config.ts index 0cabdc7768e3..ea813fca34f3 100644 --- a/libs/ledger-live-common/jest.config.ts +++ b/libs/ledger-live-common/jest.config.ts @@ -38,12 +38,10 @@ const defaultConfig = { "ts-jest": { isolatedModules: true, }, - Buffer: Uint8Array, }, testEnvironment: "node", reporters, coveragePathIgnorePatterns: ["src/__tests__/test-helpers"], - setupFiles: ["./jest.polyfills.js"], modulePathIgnorePatterns: [ "__tests__/fixtures", "__tests__/migration", diff --git a/libs/ledger-live-common/jest.polyfills.js b/libs/ledger-live-common/jest.polyfills.js deleted file mode 100644 index c1ab39c2033e..000000000000 --- a/libs/ledger-live-common/jest.polyfills.js +++ /dev/null @@ -1,5 +0,0 @@ -const { Buffer } = require("./node_modules/buffer"); - -Object.defineProperties(globalThis, { - Buffer: { value: Buffer }, -}); diff --git a/libs/ledger-live-common/src/families/celo/bridge.integration.test.ts b/libs/ledger-live-common/src/families/celo/bridge.integration.test.ts index 19018522c02a..b4ab83b4646b 100644 --- a/libs/ledger-live-common/src/families/celo/bridge.integration.test.ts +++ b/libs/ledger-live-common/src/families/celo/bridge.integration.test.ts @@ -4,6 +4,12 @@ import celo from "./datasets/celo.scanAccounts.1"; import type { Transaction } from "./types"; import type { DatasetTest } from "@ledgerhq/types-live"; +const { Buffer } = require("../../../node_modules/buffer"); + +Object.defineProperties(globalThis, { + Buffer: { value: Buffer }, +}); + const dataset: DatasetTest = { implementations: ["js"], currencies: {