From c9b6c9fe4e7b8501f957dd4a4f837d200d911ea1 Mon Sep 17 00:00:00 2001 From: ssube Date: Wed, 13 Nov 2019 23:27:16 -0600 Subject: [PATCH] fix(tests): mock config when listing rules --- test/TestApp.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/TestApp.ts b/test/TestApp.ts index 54e2fd9..0794174 100644 --- a/test/TestApp.ts +++ b/test/TestApp.ts @@ -11,7 +11,20 @@ describeLeaks('main app', async () => { }); itLeaks('should list rules and exit', async () => { - const status = await main(['node', 'test', 'list']); + mockFs({ + docs: { + 'config.yml': 'data: {logger: {level: debug, name: test, stream: !stream stderr}}', + }, + }); + + const status = await main([ + 'node', 'test', 'list', + '--config-path', 'docs', + '--config-name', 'config.yml', + ]); + + mockFs.restore(); + expect(status).to.equal(STATUS_SUCCESS); });