aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/process-nexttick.test.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-07 14:14:19 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-07 14:14:19 -0800
commit2eb19a96b11b75e65cde00d6ac1c358b30020ef6 (patch)
treea0210130319cfd4531c9b0df52ff6447bb58c8aa /test/bun.js/process-nexttick.test.js
parentfd26d2e9fa3a98803244d2d4d7cb8c657d4efe2a (diff)
downloadbun-2eb19a96b11b75e65cde00d6ac1c358b30020ef6.tar.gz
bun-2eb19a96b11b75e65cde00d6ac1c358b30020ef6.tar.zst
bun-2eb19a96b11b75e65cde00d6ac1c358b30020ef6.zip
Support unlimited arguments in process.nextTick
Diffstat (limited to 'test/bun.js/process-nexttick.test.js')
-rw-r--r--test/bun.js/process-nexttick.test.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/bun.js/process-nexttick.test.js b/test/bun.js/process-nexttick.test.js
index ac53399c0..f6d2b7663 100644
--- a/test/bun.js/process-nexttick.test.js
+++ b/test/bun.js/process-nexttick.test.js
@@ -78,7 +78,9 @@ it("process.nextTick", async () => {
"queueMicrotask should throw a TypeError if the argument is empty"
);
}
+});
+it("process.nextTick 2 args", async () => {
await new Promise((resolve, reject) => {
process.nextTick(
(first, second) => {
@@ -91,3 +93,14 @@ it("process.nextTick", async () => {
);
});
});
+
+it("process.nextTick 5 args", async () => {
+ await new Promise((resolve, reject) => {
+ var args = [12345, "hello", "hello", "hello", 5];
+ process.nextTick((...receivedArgs) => {
+ if (!args.every((arg, index) => arg === receivedArgs[index]))
+ reject(new Error("process.nextTick called with wrong arguments"));
+ resolve(true);
+ }, ...args);
+ });
+});