PageRenderTime 19ms CodeModel.GetById 12ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/expresso/test/serial/async.test.js

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
JavaScript | 39 lines | 33 code | 6 blank | 0 comment | 0 complexity | 90532286c86a1148caddce42cfd3762d MD5 | raw file
 1
 2var assert = require('assert')
 3  , setup = 0
 4  , order = [];
 5
 6module.exports = {
 7    setup: function(done){
 8        ++setup;
 9        done();
10    },
11
12    a: function(done){
13        assert.equal(1, setup);
14        order.push('a');
15        setTimeout(function(){
16            done();
17        }, 500);
18    },
19    
20    b: function(done){
21        assert.equal(2, setup);
22        order.push('b');
23        setTimeout(function(){
24            done();
25        }, 200);
26    },
27    
28    c: function(done){
29        assert.equal(3, setup);
30        order.push('c');
31        setTimeout(function(){
32            done();
33        }, 1000);
34    },
35
36    d: function(){
37        assert.eql(order, ['a', 'b', 'c']);
38    }
39};