Welcome to mirror list, hosted at ThFree Co, Russian Federation.

simple.js « test « promzard « node_modules - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 034a86475afbd5c0c1c3a1a86c96702a2443be9f (plain)
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
var test = require('tap').test;
var promzard = require('../');

test('simple', function (t) {
    t.plan(1);
    
    var ctx = { tmpdir : '/tmp' }
    var file = __dirname + '/simple.input';
    promzard(file, ctx, function (err, output) {
        t.same(
            {
                a : 3,
                b : '!2b',
                c : {
                    x : 55,
                    y : '/tmp/y/file.txt',
                }
            },
            output
        );
    });
    
    setTimeout(function () {
        process.stdin.emit('data', '\n');
    }, 100);
    
    setTimeout(function () {
        process.stdin.emit('data', '55\n');
    }, 200);
});