From 421b0b5771cb009e8788a59bc21ddee16ad21435 Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:16:08 -0700 Subject: [PATCH] Linting. --- .../__tests__/platform/BrowserEncoding.test.ts | 1 - packages/sdk/browser/jest.config.json | 18 ++++-------------- packages/sdk/browser/setup-jest.js | 8 +++----- packages/sdk/cloudflare/jsr.json | 12 ++---------- 4 files changed, 9 insertions(+), 30 deletions(-) diff --git a/packages/sdk/browser/__tests__/platform/BrowserEncoding.test.ts b/packages/sdk/browser/__tests__/platform/BrowserEncoding.test.ts index 085734a7b..ad81b83bf 100644 --- a/packages/sdk/browser/__tests__/platform/BrowserEncoding.test.ts +++ b/packages/sdk/browser/__tests__/platform/BrowserEncoding.test.ts @@ -1,6 +1,5 @@ import BrowserEncoding from '../../src/platform/BrowserEncoding'; - it('can base64 a basic ASCII string', () => { const encoding = new BrowserEncoding(); expect(encoding.btoa('toaster')).toEqual('dG9hc3Rlcg=='); diff --git a/packages/sdk/browser/jest.config.json b/packages/sdk/browser/jest.config.json index 9c86b13e0..6d2e223cd 100644 --- a/packages/sdk/browser/jest.config.json +++ b/packages/sdk/browser/jest.config.json @@ -1,16 +1,9 @@ { "verbose": true, "testEnvironment": "jest-environment-jsdom", - "testPathIgnorePatterns": [ - "./dist", - "./src" - ], - "testMatch": [ - "**.test.ts" - ], - "setupFiles": [ - "./setup-jest.js" - ], + "testPathIgnorePatterns": ["./dist", "./src"], + "testMatch": ["**.test.ts"], + "setupFiles": ["./setup-jest.js"], "transform": { "^.+\\.ts$": [ "ts-jest", @@ -18,9 +11,6 @@ "tsConfig": "tsconfig.test.json" } ], - "^.+.tsx?$": [ - "ts-jest", - {} - ] + "^.+.tsx?$": ["ts-jest", {}] } } diff --git a/packages/sdk/browser/setup-jest.js b/packages/sdk/browser/setup-jest.js index 95d06357e..e17ac62cb 100644 --- a/packages/sdk/browser/setup-jest.js +++ b/packages/sdk/browser/setup-jest.js @@ -8,17 +8,15 @@ Object.assign(window, { TextDecoder, TextEncoder }); // Based on: // https://stackoverflow.com/a/71750830 -Object.defineProperty(global.self, "crypto", { +Object.defineProperty(global.self, 'crypto', { value: { getRandomValues: (arr) => crypto.randomBytes(arr.length), subtle: { digest: (algorithm, data) => { return new Promise((resolve) => resolve( - crypto.createHash(algorithm.toLowerCase().replace("-", "")) - .update(data) - .digest() - ) + crypto.createHash(algorithm.toLowerCase().replace('-', '')).update(data).digest(), + ), ); }, }, diff --git a/packages/sdk/cloudflare/jsr.json b/packages/sdk/cloudflare/jsr.json index 62b0c6d0b..61c54a978 100644 --- a/packages/sdk/cloudflare/jsr.json +++ b/packages/sdk/cloudflare/jsr.json @@ -3,15 +3,7 @@ "version": "2.6.0", "exports": "./src/index.ts", "publish": { - "include": [ - "LICENSE", - "README.md", - "package.json", - "jsr.json", - "src/**/*.ts" - ], - "exclude": [ - "src/**/*.test.ts" - ] + "include": ["LICENSE", "README.md", "package.json", "jsr.json", "src/**/*.ts"], + "exclude": ["src/**/*.test.ts"] } }