From 1d9fca25dca7a3f1ecb98e4d9ebe8e4793df8bc3 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 17 Jul 2013 17:07:31 +0800 Subject: [PATCH] Add test for setImmediate and process.nextTick. --- spec/node/message_loop.coffee | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 spec/node/message_loop.coffee diff --git a/spec/node/message_loop.coffee b/spec/node/message_loop.coffee new file mode 100644 index 000000000000..a934814c73af --- /dev/null +++ b/spec/node/message_loop.coffee @@ -0,0 +1,20 @@ +assert = require 'assert' + +describe 'message loop', -> + describe 'process.nextTick', -> + it 'should emit the callback', (done) -> + process.nextTick done + + it 'should work in nested calls', (done) -> + process.nextTick -> + process.nextTick -> + process.nextTick done + + describe 'setImmediate', -> + it 'should emit the callback', (done) -> + setImmediate done + + it 'should work in nested calls', (done) -> + setImmediate -> + setImmediate -> + setImmediate done