-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
34 lines (23 loc) · 953 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* index.js: test for worker callback being undefined
*
* (C) 2012 Crosstalk Systems Inc.
*/
"use strict";
var state = { status : "initializing" };
crosstalk.on( "test.callback.should.be.defined", function ( params, callback ) {
if ( ! state[ 'callback.should.be.defined' ] ) {
state[ 'callback.should.be.defined' ] = callback ? 'pass' : 'fail';
}
if ( callback ) return callback();
}); // crosstalk.on 'callback.should.be.defined.test'
crosstalk.on( "test.callback.should.be.undefined", function ( params, callback ) {
if ( ! state[ 'callback.should.be.undefined' ] ) {
state[ 'callback.should.be.undefined' ] = callback ? 'fail' : 'pass';
}
if ( callback ) return callback(); // don't break test runner if test fails
}); // crosstalk.on 'callback.should.be.defined.test'
crosstalk.on( "test.callback.presence.state", function ( params, callback ) {
return callback( null, state );
});
state.status = "ready";