Skip to content

Commit bb8709f

Browse files
committed
Remove unnecessary fix to @types/node
1 parent 5ffe820 commit bb8709f

File tree

8 files changed

+26
-124
lines changed

8 files changed

+26
-124
lines changed

v-next/hardhat-node-test-reporter/src/diagnostics.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TestEventData } from "./node-types.js";
1+
import type { TestEventData } from "./types.js";
22

33
export interface GlobalDiagnostics {
44
tests: number;

v-next/hardhat-node-test-reporter/src/formatting.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { GlobalDiagnostics } from "./diagnostics.js";
2-
import type { TestEventData } from "./node-types.js";
2+
import type { TestEventData } from "./types.js";
33

44
import chalk from "chalk";
55

v-next/hardhat-node-test-reporter/src/github-actions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TestEventData } from "./node-types.js";
1+
import type { TestEventData } from "./types.js";
22

33
import path from "node:path";
44
import { fileURLToPath } from "node:url";

v-next/hardhat-node-test-reporter/src/node-types.ts

-101
This file was deleted.

v-next/hardhat-node-test-reporter/src/reporter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {
33
TestEventData,
44
TestEventSource,
55
TestReporterResult,
6-
} from "./node-types.js";
6+
} from "./types.js";
77

88
import chalk from "chalk";
99

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { TestEvent } from "node:test/reporters";
2+
3+
/**
4+
* A map from event type to its data type.
5+
*/
6+
export type TestEventData = UnionToObject<TestEvent>;
7+
8+
type UnionToObject<T extends { type: string }> = {
9+
[K in T as K["type"]]: K extends { type: K["type"]; data: infer D }
10+
? D
11+
: never;
12+
};
13+
14+
/**
15+
* The type of the event source that the reporter will receive.
16+
*/
17+
export type TestEventSource = AsyncGenerator<TestEvent, void>;
18+
19+
/**
20+
* The type of the result of the reporter.
21+
*/
22+
export type TestReporterResult = AsyncGenerator<string, void>;

v-next/hardhat-node-test-reporter/test/node-types.ts

-19
This file was deleted.

v-next/hardhat-node-test-reporter/test/nop.ts

Whitespace-only changes.

0 commit comments

Comments
 (0)