Skip to content

Commit

Permalink
fix pnpm init command
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed May 19, 2023
1 parent 4b9dd0a commit b6c3816
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 @@ -37,7 +37,7 @@ export class PNPMProxy extends JsPackageManager {
async initPackageJson() {
await this.executeCommand({
command: 'pnpm',
args: ['init', '-y'],
args: ['init'],
});
}

Expand Down

0 comments on commit b6c3816

Please sign in to comment.