1 | var assert = require('assert');
|
2 | var dg = require( '../lib/dg.js' );
|
3 | var test = [ 'test', 'another test', 1234, 'a string' ];
|
4 |
|
5 | it( 'Expression (asynchronous): object returned', function () {
|
6 | dg.async( test, new RegExp( '^test$' ) ).then(
|
7 | function (r) {
|
8 | assert( typeof r, 'object' )
|
9 | }
|
10 | )
|
11 | } );
|
12 |
|
13 | it( 'Function (asynchronous): correct value returned', function () {
|
14 | dg.async( test, function (t) { if ( t == 'test' ) return 1 }, function (r) {
|
15 | assert.equal( r, [ 'test' ] )
|
16 | } ) }
|
17 | );
|