From 36f05d5a8bb5c56437204a37f12fc4b2e31c5430 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Sun, 10 Mar 2024 17:48:09 -0700 Subject: [PATCH] fix: Ensure the logger is wired up before running liftoff (#258) --- index.js | 3 +++ test/config-description.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 318e1755..6ff75f34 100644 --- a/index.js +++ b/index.js @@ -66,6 +66,9 @@ var parser = yargs var opts = parser.parse(); +// Set up event listeners for logging temporarily. +toConsole(log, opts); + cli.on('preload:before', function(name) { log.info('Preloading external module:', chalk.magenta(name)); }); diff --git a/test/config-description.js b/test/config-description.js index ac85fd70..2a185459 100644 --- a/test/config-description.js +++ b/test/config-description.js @@ -48,7 +48,7 @@ describe('config: description', function() { expect(err).toBeNull(); expect(stderr).toEqual(''); var expected = fs.readFileSync(path.join(expectedDir, 'output2.txt'), 'utf-8'); - expect(sliceLines(stdout, 1)).toEqual(expected); + expect(sliceLines(stdout, 2)).toEqual(expected); done(err); } });