Skip to content

Commit 905c344

Browse files
chore: address minor linting issues in test polyfills
1 parent 1dbf59f commit 905c344

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

service/src/crypto.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* without any mocking.
99
*/
1010

11-
import { webcrypto } from 'crypto';
11+
import { webcrypto } from 'node:crypto';
1212

1313
// Polyfill for Node versions < 19 that do not expose globalThis.crypto
1414
if (!globalThis.crypto) {
@@ -18,7 +18,7 @@ if (!globalThis.crypto) {
1818
// cryptoRSA.ts accesses `window.crypto`, `window.btoa`, and `window.atob`.
1919
// In a Node (non-jsdom) environment `window` is undefined, so we point it at
2020
// globalThis which already has btoa/atob (Node 16+) and crypto (Node 19+).
21-
if (typeof window === 'undefined') {
21+
if (typeof globalThis.window === 'undefined') {
2222
(globalThis as any).window = globalThis;
2323
}
2424

service/src/cryptoecdh.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* in both Node.js and browser environments.
66
*/
77

8-
import { webcrypto } from 'crypto';
8+
import { webcrypto } from 'node:crypto';
99

1010
if (!globalThis.crypto) {
1111
(globalThis as any).crypto = webcrypto;
1212
}
1313

14-
if (typeof window === 'undefined') {
14+
if (typeof globalThis.window === 'undefined') {
1515
(globalThis as any).window = globalThis;
1616
}
1717

0 commit comments

Comments
 (0)