Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests config #707

Merged
merged 2 commits into from
Apr 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
},
"devDependencies": {
"jest-environment-jsdom": "^29.1.2",
"rete-cli": "^1.0.2",
"rete-cli": "^1.0.3",
"typescript": "4.8.4"
},
"dependencies": {
13 changes: 10 additions & 3 deletions test/mocks/crypto.ts
Original file line number Diff line number Diff line change
@@ -3,7 +3,10 @@ import { Buffer } from 'buffer'

export function mockCrypto(object: Record<string, unknown>) {
// eslint-disable-next-line no-undef
globalThis.crypto = object as unknown as Crypto
Object.defineProperty(globalThis, 'crypto', {
value: object,
writable: true
})
}

export function mockCryptoFromArray(array: Uint8Array) {
@@ -19,6 +22,10 @@ export function mockCryptoFromBuffer(buffer: Buffer) {
}

export function resetCrypto() {
// eslint-disable-next-line no-undef, no-undefined
globalThis.crypto = undefined as unknown as Crypto
// eslint-disable-next-line no-undef
Object.defineProperty(globalThis, 'crypto', {
// eslint-disable-next-line no-undefined
value: undefined,
writable: true
})
}

Unchanged files with check annotations Beta

*/
export type Pipe<T> = (data: T) => Promise<undefined | T> | undefined | T
export type CanAssignEach<D extends any[], F extends any[]> = D extends [infer H1, ...infer Tail1]

Check warning on line 19 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 19 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 19 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 19 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type
? (
F extends [infer H2, ...infer Tail2] ?
[CanAssignSignal<H1, H2>, ...CanAssignEach<Tail1, Tail2>]
: []
) : []
export type ScopeAsParameter<S extends Scope<any, any[]>, Current extends any[]> = (CanAssignEach<[S['__scope']['produces'], ...S['__scope']['parents']], Current>[number] extends true

Check warning on line 26 in src/scope.ts

GitHub Actions / ci / ci

This line has a length of 183. Maximum allowed is 120

Check warning on line 26 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 26 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 26 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 26 in src/scope.ts

GitHub Actions / ci / ci

This line has a length of 183. Maximum allowed is 120

Check warning on line 26 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 26 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 26 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type
? S
: 'Argument Scope does not provide expected signals'
)
* Validate the Scope signals and replace the parameter type with an error message if they are not assignable
* @internal
*/
export type NestedScope<S extends Scope<any, any[]>, Current extends any[]> = (CanAssignEach<Current, S['__scope']['parents']>[number] extends true

Check warning on line 35 in src/scope.ts

GitHub Actions / ci / ci

This line has a length of 147. Maximum allowed is 120

Check warning on line 35 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 35 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 35 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 35 in src/scope.ts

GitHub Actions / ci / ci

This line has a length of 147. Maximum allowed is 120

Check warning on line 35 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 35 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type

Check warning on line 35 in src/scope.ts

GitHub Actions / ci / ci

Unexpected any. Specify a different type
? S
: 'Parent signals do not satisfy the connected scope. Please use `.debug($ => $) for detailed assignment error'
)