Skip to content

Commit

Permalink
Fix package manager mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Nov 9, 2023
1 parent f6023ed commit b5b68a9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions node-src/tasks/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ describe('setBuildCommand', () => {
});

it('supports yarn', async () => {
mockfs({ './package.json': JSON.stringify({ packageManager: 'yarn' }) });
mockfs({
'./package.json': JSON.stringify({ packageManager: 'yarn' }),
'./yarn.lock': '',
});

const ctx = {
sourceDir: './source-dir/',
Expand All @@ -70,7 +73,10 @@ describe('setBuildCommand', () => {
});

it('supports pnpm', async () => {
mockfs({ './package.json': JSON.stringify({ packageManager: 'pnpm' }) });
mockfs({
'./package.json': JSON.stringify({ packageManager: 'pnpm' }),
'./pnpm-lock.yaml': '',
});

const ctx = {
sourceDir: './source-dir/',
Expand Down
10 changes: 8 additions & 2 deletions node-src/tasks/initialize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ describe('setRuntimeMetadata', () => {
});

it('supports yarn', async () => {
mockfs({ './package.json': JSON.stringify({ packageManager: 'yarn' }) });
mockfs({
'./package.json': JSON.stringify({ packageManager: 'yarn' }),
'./yarn.lock': '',
});

const ctx = {
sourceDir: './source-dir/',
Expand All @@ -75,7 +78,10 @@ describe('setRuntimeMetadata', () => {
});

it('supports pnpm', async () => {
mockfs({ './package.json': JSON.stringify({ packageManager: 'pnpm' }) });
mockfs({
'./package.json': JSON.stringify({ packageManager: 'pnpm' }),
'./pnpm-lock.yaml': '',
});

const ctx = {
sourceDir: './source-dir/',
Expand Down

0 comments on commit b5b68a9

Please sign in to comment.