From bdc95f742aeb3bffa26c72c8c8e46c416e7b1802 Mon Sep 17 00:00:00 2001 From: kreuzerk Date: Sat, 20 Jan 2024 11:09:57 +0100 Subject: [PATCH] =?UTF-8?q?test:=20=F0=9F=92=8D=20fix=20failing=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/nx-release/src/executors/npm-publish/executor.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/nx-release/src/executors/npm-publish/executor.spec.ts b/libs/nx-release/src/executors/npm-publish/executor.spec.ts index 30f350a..8d07b63 100644 --- a/libs/nx-release/src/executors/npm-publish/executor.spec.ts +++ b/libs/nx-release/src/executors/npm-publish/executor.spec.ts @@ -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 = { @@ -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);