Commits

Sean Wilkinson committed e89f7c3

Added some asynchronous tests

Comments (0)

Files changed (1)

test/quanah-spec.js

 //  part of an NPM-based workflow.
 //
 //                                                      ~~ (c) SRW, 17 Nov 2012
-//                                                  ~~ last updated 12 Feb 2013
+//                                                  ~~ last updated 15 Feb 2013
 
 (function () {
     'use strict';
             });
         });
 
+        it('should wait for short async operations', function (done) {
+            var x = avar();
+            x.Q(function (evt) {
+             // This function needs documentation.
+                process.nextTick(evt.exit);
+                return;
+            }).Q(function (evt) {
+             // This function needs documentation.
+                done();
+                return evt.exit();
+            });
+        });
+
+        it('should wait for long[er] async operations', function (done) {
+            var x = avar();
+            x.Q(function (evt) {
+             // This function needs documentation.
+                setTimeout(evt.exit, 1000);
+                return;
+            }).Q(function (evt) {
+             // This function needs documentation.
+                done();
+                return evt.exit();
+            });
+        });
+
         it('should relay error messages from "nested avars"', function (done) {
             var x = avar();
             x.Q(function (evt) {