Skip to content

Commit

Permalink
Add shell & binary test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Jul 6, 2022
1 parent 337eb7f commit 062b15e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/acc.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,29 @@ export ALICLOUD_ACCESS_KEY_SECRET=aksecret\n`);
assert.deepStrictEqual(stdout, ``);
assert.deepStrictEqual(code, 1);
});

it('acc run -- with script', async function () {
const {code, stderr} = await spawn('node', ['../bin/acc.js', 'run', '--', 'npm', '-v'], {
cwd: __dirname,
env: {
...process.env,
'ALIBABACLOUD_CONFIG': path.join(__dirname, 'figures/aliyun.json')
}
});
assert.deepStrictEqual(stderr, ``);
assert.deepStrictEqual(code, 0);
});

it('acc run -- with binary', async function () {
const {code, stdout, stderr} = await spawn('node', ['../bin/acc.js', 'run', '--', 'node', '-v'], {
cwd: __dirname,
env: {
...process.env,
'ALIBABACLOUD_CONFIG': path.join(__dirname, 'figures/aliyun.json')
}
});
assert.deepStrictEqual(stderr, ``);
assert.ok(stdout.startsWith(process.version));
assert.deepStrictEqual(code, 0);
});
});

0 comments on commit 062b15e

Please sign in to comment.