aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/process-nexttick.test.js
diff options
context:
space:
mode:
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);
+ });
+});