From cfacc4a878afb198d0fc93d7c5d31db05ca71165 Mon Sep 17 00:00:00 2001 From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in> Date: Mon, 18 Nov 2024 19:48:04 +0530 Subject: [PATCH] removing unwated files and environment related fixes --- packages/caravan-wallets/jest.config.ts | 22 ------------------- packages/caravan-wallets/jest.setup.ts | 4 ---- packages/caravan-wallets/package.json | 2 +- .../src/__tests__/coldcard.test.ts | 2 ++ .../src/__tests__/custom.test.ts | 2 ++ .../src/__tests__/hermit.test.ts | 2 ++ .../src/__tests__/interaction.test.ts | 2 ++ .../src/__tests__/ledger.test.ts | 2 ++ .../src/__tests__/trezor.test.ts | 2 ++ 9 files changed, 13 insertions(+), 27 deletions(-) delete mode 100644 packages/caravan-wallets/jest.config.ts delete mode 100644 packages/caravan-wallets/jest.setup.ts diff --git a/packages/caravan-wallets/jest.config.ts b/packages/caravan-wallets/jest.config.ts deleted file mode 100644 index 24ad6c77..00000000 --- a/packages/caravan-wallets/jest.config.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { JestConfigWithTsJest } from "ts-jest"; - -const config: JestConfigWithTsJest = { - extensionsToTreatAsEsm: [".ts"], - verbose: true, - - testEnvironment: "node", - testPathIgnorePatterns: ["./lib"], - transformIgnorePatterns: ["/node_modules/(?!uint8array-tools)"], - transform: { - "^.+\\.js$": "babel-jest", - "^.+\\.ts?$": [ - "ts-jest", - { - useESM: true, - }, - ], - }, - setupFiles: ["/jest.setup.ts"], -}; - -export default config; diff --git a/packages/caravan-wallets/jest.setup.ts b/packages/caravan-wallets/jest.setup.ts deleted file mode 100644 index e8018ff0..00000000 --- a/packages/caravan-wallets/jest.setup.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { jest } from "@jest/globals"; - -global.jest = jest; -import "@inrupt/jest-jsdom-polyfills"; diff --git a/packages/caravan-wallets/package.json b/packages/caravan-wallets/package.json index 521ba481..414f5ad3 100644 --- a/packages/caravan-wallets/package.json +++ b/packages/caravan-wallets/package.json @@ -65,7 +65,7 @@ "ci": "npm run lint && npm run test", "dev": "npm run build -- --watch", "test": "vitest --watch=false src", - "test:watch": "vitest --watch src", + "test:watch": "vitest --watch src ", "test:debug": "node --inspect-brk vitest --runInBand", "docs": "./bin/build-docs.sh", "lint": "eslint src --ignore-pattern src/vendor" diff --git a/packages/caravan-wallets/src/__tests__/coldcard.test.ts b/packages/caravan-wallets/src/__tests__/coldcard.test.ts index d4bf1fe6..fb087605 100644 --- a/packages/caravan-wallets/src/__tests__/coldcard.test.ts +++ b/packages/caravan-wallets/src/__tests__/coldcard.test.ts @@ -1,3 +1,5 @@ +// @vitest-environment jsdom + import { ColdcardExportPublicKey, ColdcardExportExtendedPublicKey, diff --git a/packages/caravan-wallets/src/__tests__/custom.test.ts b/packages/caravan-wallets/src/__tests__/custom.test.ts index 5a480bc0..c64f39c4 100644 --- a/packages/caravan-wallets/src/__tests__/custom.test.ts +++ b/packages/caravan-wallets/src/__tests__/custom.test.ts @@ -1,3 +1,5 @@ +// @vitest-environment jsdom + import { CustomExportExtendedPublicKey, CustomSignMultisigTransaction, diff --git a/packages/caravan-wallets/src/__tests__/hermit.test.ts b/packages/caravan-wallets/src/__tests__/hermit.test.ts index 6ca8f412..e63fdb1c 100644 --- a/packages/caravan-wallets/src/__tests__/hermit.test.ts +++ b/packages/caravan-wallets/src/__tests__/hermit.test.ts @@ -1,3 +1,5 @@ +// @vitest-environment jsdom + import { PENDING, INFO } from "../interaction"; import { HermitExportExtendedPublicKey, diff --git a/packages/caravan-wallets/src/__tests__/interaction.test.ts b/packages/caravan-wallets/src/__tests__/interaction.test.ts index fbadc2dd..5f9153af 100644 --- a/packages/caravan-wallets/src/__tests__/interaction.test.ts +++ b/packages/caravan-wallets/src/__tests__/interaction.test.ts @@ -1,3 +1,5 @@ +// @vitest-environment jsdom + import { UNSUPPORTED, PENDING, diff --git a/packages/caravan-wallets/src/__tests__/ledger.test.ts b/packages/caravan-wallets/src/__tests__/ledger.test.ts index 886ad029..9687a7bc 100644 --- a/packages/caravan-wallets/src/__tests__/ledger.test.ts +++ b/packages/caravan-wallets/src/__tests__/ledger.test.ts @@ -1,3 +1,5 @@ +// @vitest-environment jsdom + import { TEST_FIXTURES, ROOT_FINGERPRINT, Network } from "@caravan/bitcoin"; import { PENDING, ACTIVE, INFO, WARNING, ERROR } from "../interaction"; import { diff --git a/packages/caravan-wallets/src/__tests__/trezor.test.ts b/packages/caravan-wallets/src/__tests__/trezor.test.ts index 5425a469..13d338be 100644 --- a/packages/caravan-wallets/src/__tests__/trezor.test.ts +++ b/packages/caravan-wallets/src/__tests__/trezor.test.ts @@ -1,3 +1,5 @@ +// @vitest-environment jsdom + import { ROOT_FINGERPRINT, TEST_FIXTURES,