From a1e2d9fb97b18f3ed7a0acb432d95749dae3899c Mon Sep 17 00:00:00 2001 From: Egge Date: Tue, 26 Nov 2024 22:49:13 +0000 Subject: [PATCH] import globals (fixes tsc) --- test/WSConnection.test.ts | 2 +- test/base64.test.ts | 1 + test/cbor.test.ts | 1 + test/integration.test.ts | 1 + test/paymentRequests.test.ts | 7 +------ test/request.test.ts | 2 +- test/utils.test.ts | 1 + test/wallet.test.ts | 2 +- 8 files changed, 8 insertions(+), 9 deletions(-) diff --git a/test/WSConnection.test.ts b/test/WSConnection.test.ts index d761f90c7..be9dbea2d 100644 --- a/test/WSConnection.test.ts +++ b/test/WSConnection.test.ts @@ -1,7 +1,7 @@ import { WSConnection } from '../src/WSConnection'; import { Client, Server, WebSocket } from 'mock-socket'; import { injectWebSocketImpl } from '../src/ws'; -import { vi } from 'vitest'; +import { vi, test, describe, expect } from 'vitest'; injectWebSocketImpl(WebSocket); diff --git a/test/base64.test.ts b/test/base64.test.ts index 45a9b50be..bf85552fd 100644 --- a/test/base64.test.ts +++ b/test/base64.test.ts @@ -4,6 +4,7 @@ import { encodeJsonToBase64, encodeUint8toBase64 } from '../src/base64.js'; +import { test, describe, expect } from 'vitest'; describe('testing uint8 encoding', () => { test('uint8 to base64', async () => { const message = 'test'; diff --git a/test/cbor.test.ts b/test/cbor.test.ts index be209adbc..da544d3aa 100644 --- a/test/cbor.test.ts +++ b/test/cbor.test.ts @@ -1,5 +1,6 @@ import { decodeCBOR, encodeCBOR } from '../src/cbor'; import { bytesToHex, hexToBytes } from '@noble/curves/abstract/utils'; +import { test, describe, expect } from 'vitest'; const tests = [ { diff --git a/test/integration.test.ts b/test/integration.test.ts index 1fe1a9161..7bf61f4a7 100644 --- a/test/integration.test.ts +++ b/test/integration.test.ts @@ -2,6 +2,7 @@ import { CashuMint } from '../src/CashuMint.js'; import { CashuWallet } from '../src/CashuWallet.js'; import dns from 'node:dns'; +import { test, describe, expect } from 'vitest'; import { vi } from 'vitest'; import { secp256k1 } from '@noble/curves/secp256k1'; import { bytesToHex } from '@noble/curves/abstract/utils'; diff --git a/test/paymentRequests.test.ts b/test/paymentRequests.test.ts index b06689dcf..8ee7eee31 100644 --- a/test/paymentRequests.test.ts +++ b/test/paymentRequests.test.ts @@ -1,12 +1,7 @@ -import nock from 'nock'; -import { CashuMint } from '../src/CashuMint.js'; -import { CashuWallet } from '../src/CashuWallet.js'; -import { setGlobalRequestOptions } from '../src/request.js'; -import { MeltQuoteResponse } from '../src/model/types/index.js'; +import { test, describe, expect } from 'vitest'; import { decodePaymentRequest, PaymentRequest, - PaymentRequestPayload, PaymentRequestTransport, PaymentRequestTransportType } from '../src/index.js'; diff --git a/test/request.test.ts b/test/request.test.ts index 5ff7bcd24..59d077387 100644 --- a/test/request.test.ts +++ b/test/request.test.ts @@ -1,4 +1,4 @@ -import nock from 'nock'; +import { beforeAll, beforeEach, test, describe, expect } from 'vitest'; import { CashuMint } from '../src/CashuMint.js'; import { CashuWallet } from '../src/CashuWallet.js'; import { setGlobalRequestOptions } from '../src/request.js'; diff --git a/test/utils.test.ts b/test/utils.test.ts index cafa3de0a..1d6b9dc7c 100644 --- a/test/utils.test.ts +++ b/test/utils.test.ts @@ -3,6 +3,7 @@ import { constructProofFromPromise, serializeProof } from '@cashu/crypto/modules/client'; +import { test, describe, expect } from 'vitest'; import { Keys, Proof } from '../src/model/types/index.js'; import * as utils from '../src/utils.js'; import { PUBKEYS } from './consts.js'; diff --git a/test/wallet.test.ts b/test/wallet.test.ts index 65d591120..972a3bce5 100644 --- a/test/wallet.test.ts +++ b/test/wallet.test.ts @@ -1,6 +1,6 @@ -import nock from 'nock'; import { setupServer } from 'msw/node'; import { HttpResponse, http } from 'msw'; +import { beforeAll, beforeEach, afterAll, afterEach, test, describe, expect } from 'vitest'; import { CashuMint } from '../src/CashuMint.js'; import { CashuWallet } from '../src/CashuWallet.js';