summaryrefslogtreecommitdiff
path: root/support/es.test.js
blob: 3107e137d2864c525267ecf305bbc3da36046e62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// simple async example to test ES module build output

import {waterfall as waterfall} from  "../build/es/index";
import async from "../build/es/index";
import constant from "../build/es/constant";

waterfall([
    constant(42),
    function (val, next) {
        async.setImmediate(function () {
            next(null, val);
        });
    }
], function (err, result) {
    if (err) { throw err; }
    console.log(result);
    if (result !== 42) {
        console.log("fail");
        process.exit(1);
    }
});