From 16db159ca3fb64a51f0076881bea5df37e4edce9 Mon Sep 17 00:00:00 2001 From: Eric Willhoit Date: Wed, 3 Nov 2021 15:30:08 -0500 Subject: [PATCH] fix: test for Windows --- src/commands/info/releasenotes/display.ts | 1 + src/shared/get-info-config.ts | 1 + test/shared/get-info-config.test.ts | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/commands/info/releasenotes/display.ts b/src/commands/info/releasenotes/display.ts index 90c6306a..af8ec385 100644 --- a/src/commands/info/releasenotes/display.ts +++ b/src/commands/info/releasenotes/display.ts @@ -74,6 +74,7 @@ export default class Display extends SfdxCommand { warn('Loading plugin-info config from package.json failed with message:', err); return; } + const { distTagUrl, releaseNotesPath, releaseNotesFilename } = infoConfig.releasenotes; let version = (this.flags.version as string) || installedVersion; diff --git a/src/shared/get-info-config.ts b/src/shared/get-info-config.ts index 72b3a457..92500210 100644 --- a/src/shared/get-info-config.ts +++ b/src/shared/get-info-config.ts @@ -40,6 +40,7 @@ Add to oclif object */ export async function getInfoConfig(path: string): Promise { + // TODO: could add env var support for these values const fullPath = join(path, 'package.json'); const json = (await readJson(fullPath)) as PjsonWithInfo; diff --git a/test/shared/get-info-config.test.ts b/test/shared/get-info-config.test.ts index 4f1acb53..eb910dd8 100644 --- a/test/shared/get-info-config.test.ts +++ b/test/shared/get-info-config.test.ts @@ -54,14 +54,18 @@ describe('getInfoConfig tests', () => { it('join is called with path arg and package.json', async () => { await getInfoConfig(path); + const expected = pathPkg.join(path, 'package.json'); + expect(joinSpy.args[0]).to.deep.equal([path, 'package.json']); - expect(joinSpy.returnValues[0]).to.equal(`${path}/package.json`); + expect(joinSpy.returnValues[0]).to.equal(expected); }); it('calls readJson with pjson path', async () => { await getInfoConfig(path); - expect(readJsonStub.args[0][0]).to.deep.equal(`${path}/package.json`); + const expected = pathPkg.join(path, 'package.json'); + + expect(readJsonStub.args[0][0]).to.deep.equal(expected); }); it('info config is extracted from package.json', async () => {