1 | 'use strict';
|
2 |
|
3 | const path = require('path');
|
4 | const exec = require('child_process').exec;
|
5 | const test = require('tape');
|
6 |
|
7 | test('bin/build-template', (t) => {
|
8 | const script = path.normalize(__dirname + '/../bin/build-template.js');
|
9 | const template = path.normalize(__dirname + '/fixtures/sync-args.js');
|
10 | t.test('outputs expected', (q) => {
|
11 | exec([script, template, '--this', 'that', '-r', 'cn-north-1'].join(' '), (err, stdout, stderr) => {
|
12 | q.error(err);
|
13 | q.error(stderr);
|
14 | const result = JSON.parse(stdout);
|
15 | q.equal('that', result.this);
|
16 | q.equal('cn-north-1', result.region);
|
17 | q.end();
|
18 | });
|
19 | });
|
20 | t.end();
|
21 | });
|
22 |
|