fix(test): leaking config load
This commit is contained in:
parent
0b38b94475
commit
2fc7d7683c
|
@ -164,7 +164,6 @@ export async function parseArgs(argv: Array<string>): Promise<ParseResults> {
|
|||
.alias('version', 'v');
|
||||
|
||||
// @TODO: this should not need a cast but the parser's type omits command options and doesn't expose camelCase
|
||||
// tslint:disable-next-line:no-any
|
||||
const args = parser.parse(argv) as any;
|
||||
|
||||
return {
|
||||
|
|
|
@ -6,10 +6,17 @@ import { loadConfig, readConfig } from '../../src/config';
|
|||
import { describeLeaks, itLeaks } from '../helpers/async';
|
||||
|
||||
describeLeaks('load config helper', async () => {
|
||||
itLeaks('should load an existing config', async () => {
|
||||
const config = await loadConfig('config-stderr.yml', join(__dirname, '..', 'docs'));
|
||||
expect(config.data.logger.name).to.equal('salty-dog');
|
||||
});
|
||||
itLeaks('should load an existing config', async () =>
|
||||
expect(loadConfig('config-stderr.yml', join(__dirname, '..', 'docs'))).to.eventually.deep.include({
|
||||
data: {
|
||||
logger: {
|
||||
level: 'debug',
|
||||
name: 'salty-dog',
|
||||
stream: process.stderr,
|
||||
},
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
itLeaks('should throw when config is missing', async () =>
|
||||
expect(loadConfig('missing.yml', join(__dirname, '..', 'docs'))).to.eventually.be.rejectedWith(NotFoundError)
|
||||
|
|
Loading…
Reference in New Issue