Skip to content

Commit

Permalink
test: πŸ’ fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nivekcode committed Jan 20, 2024
1 parent 17bc07d commit bdc95f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libs/nx-release/src/executors/npm-publish/executor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ describe('NpmPublish Executor', () => {
/* eslint-disable */
jest.spyOn(projectHelpers, 'getRoot').mockReturnValue(mockRoot);

const expectedCommand = `cd ./dist/${mockRoot} && echo '//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}' > .npmrc && npm publish`
const expectedCommand = `cd ./dist/${mockRoot} && echo '//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}' >> .npmrc && npm publish`
const output = await executor({}, context);

expect(child_process.execSync).toHaveBeenCalledWith(expectedCommand);
expect(output.success).toBe(true);
});

it('should execSync with a specific npm registry if provided with one', async () => {
const mockRoot = 'libs/my-domain/foo';
const context = {
Expand All @@ -44,7 +44,7 @@ describe('NpmPublish Executor', () => {
/* eslint-disable */
jest.spyOn(projectHelpers, 'getRoot').mockReturnValue(mockRoot);

const expectedCommand = `cd ./dist/${mockRoot} && echo '//${registry}/:_authToken=${process.env.NPM_TOKEN}' > .npmrc && npm publish`
const expectedCommand = `cd ./dist/${mockRoot} && echo '//${registry}/:_authToken=${process.env.NPM_TOKEN}' >> .npmrc && npm publish`
const output = await executor({}, context);

expect(child_process.execSync).toHaveBeenCalledWith(expectedCommand);
Expand Down

0 comments on commit bdc95f7

Please sign in to comment.