Skip to content

Commit

Permalink
Merge pull request #487 from stepchowfun/typescript-integration-tests
Browse files Browse the repository at this point in the history
Simplify the integration tests
  • Loading branch information
stepchowfun authored Jun 19, 2024
2 parents c4d476b + a8c247e commit 4ad1f33
Show file tree
Hide file tree
Showing 4 changed files with 458 additions and 2,494 deletions.
22 changes: 11 additions & 11 deletions integration_tests/typescript_node/src/assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ try {
// Attempting to delete the file will fail if the file doesn't exist. This is harmless.
}

export function assertMatch<T, U>(
size: (message: T) => number,
serialize: (message: T) => ArrayBuffer,
deserialize: (dataView: DataView) => U,
actual: T,
expected: U,
export function assertMatch<O, I>(
size: (message: O) => number,
serialize: (message: O) => ArrayBuffer,
deserialize: (dataView: DataView) => I,
actual: O,
expected: unknown,
): void {
/* eslint-disable no-console -- Allow logging for this function. */

Expand All @@ -41,11 +41,11 @@ export function assertMatch<T, U>(
/* eslint-enable no-console -- Re-enable this rule. */
}

export function assertRoundTrip<U, T extends U>(
size: (message: T) => number,
serialize: (message: T) => ArrayBuffer,
deserialize: (dataView: DataView) => U,
message: T,
export function assertRoundTrip<O, I, V extends O>(
size: (message: O) => number,
serialize: (message: O) => ArrayBuffer,
deserialize: (dataView: DataView) => I,
message: V,
): void {
assertMatch(size, serialize, deserialize, message, message);
}
Loading

0 comments on commit 4ad1f33

Please sign in to comment.