1
0
Fork 0

fix: export exit statuses

This commit is contained in:
ssube 2019-11-09 21:56:49 -06:00
parent 7e24bc0724
commit e0dca3c3ad
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
2 changed files with 14 additions and 3 deletions

View File

@ -9,9 +9,9 @@ import { loadSource, writeSource } from './source';
import { VERSION_INFO } from './version';
import { VisitorContext } from './visitor/VisitorContext';
const STATUS_SUCCESS = 0;
const STATUS_ERROR = 1;
const STATUS_MAX = 255;
export const STATUS_SUCCESS = 0;
export const STATUS_ERROR = 1;
export const STATUS_MAX = 255;
export async function main(argv: Array<string>): Promise<number> {
const { args, mode } = await parseArgs(argv);

11
test/TestApp.ts Normal file
View File

@ -0,0 +1,11 @@
import { expect } from 'chai';
import { main, STATUS_SUCCESS } from '../src/app';
import { describeLeaks } from './helpers/async';
describeLeaks('main app', async () => {
xit('completion should succeed', async () => {
const status = await main(['node', 'test', 'complete']);
expect(status).to.equal(STATUS_SUCCESS);
});
});