From e0dca3c3ade3caafa7a049deb4db53951c6931f3 Mon Sep 17 00:00:00 2001 From: ssube Date: Sat, 9 Nov 2019 21:56:49 -0600 Subject: [PATCH] fix: export exit statuses --- src/app.ts | 6 +++--- test/TestApp.ts | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 test/TestApp.ts diff --git a/src/app.ts b/src/app.ts index 4329cb7..c609457 100644 --- a/src/app.ts +++ b/src/app.ts @@ -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): Promise { const { args, mode } = await parseArgs(argv); diff --git a/test/TestApp.ts b/test/TestApp.ts new file mode 100644 index 0000000..b34911c --- /dev/null +++ b/test/TestApp.ts @@ -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); + }); +});