Skip to content

Commit

Permalink
Linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinyoklion committed Oct 25, 2024
1 parent 0349691 commit 421b0b5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -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==');
Expand Down
18 changes: 4 additions & 14 deletions packages/sdk/browser/jest.config.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
{
"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",
{
"tsConfig": "tsconfig.test.json"
}
],
"^.+.tsx?$": [
"ts-jest",
{}
]
"^.+.tsx?$": ["ts-jest", {}]
}
}
8 changes: 3 additions & 5 deletions packages/sdk/browser/setup-jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
),
);
},
},
Expand Down
12 changes: 2 additions & 10 deletions packages/sdk/cloudflare/jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
}

0 comments on commit 421b0b5

Please sign in to comment.