Skip to content

Commit

Permalink
fix: test for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
iowillhoit committed Nov 3, 2021
1 parent 101a5eb commit 16db159
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/commands/info/releasenotes/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/shared/get-info-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Add to oclif object
*/

export async function getInfoConfig(path: string): Promise<InfoConfig> {
// TODO: could add env var support for these values
const fullPath = join(path, 'package.json');

const json = (await readJson(fullPath)) as PjsonWithInfo;
Expand Down
8 changes: 6 additions & 2 deletions test/shared/get-info-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit 16db159

Please sign in to comment.