]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - apps/tidep0084.git/blob - example/iot-gateway/node_modules/brfs/test/async.js
Updated to use the latest TI 15.4-Stack v2.1.0 from the SimpleLink CC13x0 SDK v1.30.
[apps/tidep0084.git] / example / iot-gateway / node_modules / brfs / test / async.js
1 var test = require('tap').test;
2 var browserify = require('browserify');
4 var vm = require('vm');
5 var fs = require('fs');
6 var path = require('path');
8 test('async', function (t) {
9     t.plan(1);
10     var b = browserify(__dirname + '/files/async.js');
11     b.transform(path.dirname(__dirname));
12     b.bundle(function (err, src) {
13         if (err) t.fail(err);
14         vm.runInNewContext(src, {
15             setTimeout: setTimeout,
16             console: { log: log }
17         });
18     });
19     function log (msg) { t.equal(msg, 'what\n') }
20 });
22 test('async encoding', function (t) {
23     t.plan(1);
24     var b = browserify(__dirname + '/files/async_encoding.js');
25     b.transform(path.dirname(__dirname));
26     b.bundle(function (err, src) {
27         if (err) t.fail(err);
28         vm.runInNewContext(src, {
29             setTimeout: setTimeout,
30             console: { log: log }
31         });
32     });
33     function log (msg) { t.equal(msg, '776861740a') }
34 });
36 test('async string encoding', function (t) {
37     t.plan(1);
38     var b = browserify(__dirname + '/files/async_str_encoding.js');
39     b.transform(path.dirname(__dirname));
40     b.bundle(function (err, src) {
41         if (err) t.fail(err);
42         vm.runInNewContext(src, {
43             setTimeout: setTimeout,
44             console: { log: log }
45         });
46     });
47     function log (msg) { t.equal(msg, '776861740a') }
48 });