Skip to content

Commit a1ee5c4

Browse files
committed
fixup!
1 parent ea8e3fe commit a1ee5c4

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.changeset/nine-rocks-appear.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/popular-pigs-glow.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
2-
"@cloudflare/unenv-preset": patch
2+
"@cloudflare/unenv-preset": minor
33
---
44

5-
Removes `node:net`, `node:timers` and `node:timers/promises` from polyfills
5+
Use the workerd implementation for Node `net`, `timers`, and `timers/promises` modules
6+
7+
- drop the polyfills
8+
- update `unenv` to 2.0.0-rc.1

packages/unenv-preset/tests/worker/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import assert from "node:assert";
22

3+
34
// List all the test functions.
45
// The test can be executing by fetching the `/${testName}` url.
56
export const TESTS = {
@@ -153,11 +154,14 @@ async function testTimers() {
153154
// active is deprecated and no more in the type
154155
(timers as any).active(timeout);
155156
timers.clearTimeout(timeout);
157+
158+
const timersPromises = await import("node:timers/promises");
159+
assert.strictEqual(await timersPromises.setTimeout(1, "timeout"), "timeout");
156160
}
157161

158162
export async function testNet() {
159163
const net = await import("node:net");
160164
assert.strictEqual(typeof net, "object");
161165
assert.strictEqual(typeof net.createConnection, "function");
162166
assert.throws(() => net.createServer(), /not implemented/);
163-
}
167+
}

0 commit comments

Comments
 (0)