Skip to content

Commit

Permalink
Merge pull request #22635 from storybookjs/fix/pnpm-init-command
Browse files Browse the repository at this point in the history
CLI: Fix pnpm init command
  • Loading branch information
shilman authored May 19, 2023
2 parents 50ad585 + b6c3816 commit 5338442
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions code/lib/cli/src/js-package-manager/PNPMProxy.test.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { PNPMProxy } from './PNPMProxy';

describe('NPM Proxy', () => {
describe('PNPM Proxy', () => {
let pnpmProxy: PNPMProxy;

beforeEach(() => {
pnpmProxy = new PNPMProxy();
});

it('type should be npm', () => {
it('type should be pnpm', () => {
expect(pnpmProxy.type).toEqual('pnpm');
});

describe('initPackageJson', () => {
it('should run `npm init -y`', async () => {
it('should run `pnpm init`', async () => {
const executeCommandSpy = jest.spyOn(pnpmProxy, 'executeCommand').mockResolvedValueOnce('');

await pnpmProxy.initPackageJson();

expect(executeCommandSpy).toHaveBeenCalledWith(
expect.objectContaining({ command: 'pnpm', args: ['init', '-y'] })
expect.objectContaining({ command: 'pnpm', args: ['init'] })
);
});
});
Expand Down Expand Up @@ -53,7 +53,7 @@ describe('NPM Proxy', () => {
});

describe('runScript', () => {
it('should execute script `yarn compodoc -- -e json -d .`', async () => {
it('should execute script `pnpm exec compodoc -- -e json -d .`', async () => {
const executeCommandSpy = jest
.spyOn(pnpmProxy, 'executeCommand')
.mockResolvedValueOnce('7.1.0');
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/js-package-manager/PNPMProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class PNPMProxy extends JsPackageManager {
async initPackageJson() {
await this.executeCommand({
command: 'pnpm',
args: ['init', '-y'],
args: ['init'],
});
}

Expand Down

0 comments on commit 5338442

Please sign in to comment.