Skip to content

Commit

Permalink
Test pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Aug 21, 2022
1 parent 1202016 commit 0498e5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
slow-test:
- defaults with npm
- defaults with yarn
# - defaults with pnpm
- defaults with pnpm
- addon-location
- test-app-location
steps:
Expand Down
25 changes: 9 additions & 16 deletions tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,21 @@ export async function install({ cwd, packageManager }: { cwd: string; packageMan
await execa('yarn', ['install', '--non-interactive'], { cwd });
} else {
if (packageManager === 'pnpm') {
try {
await execa('pnpm', ['install'], { cwd });
} catch (e) {
/**
* This is needed because the app, when generated with pnpm,
* does not have correct deps - a peer is missing, @babel/core.
* and because the app blueprint is the second blueprint we invoke
* in this blueprint,we can't add dependencies to it.
*/
if (e instanceof Error && e.message.includes('pnpm install')) {
return;
}

throw e;
}
/**
* This is needed because the app, when generated with pnpm,
* does not have correct deps - a peer is missing, @babel/core.
* and because the app blueprint is the second blueprint we invoke
* in this blueprint,we can't add dependencies to it.
*/
await fs.writeFile(path.join(cwd, '.npmrc'), 'auto-install-peers=true');
await execa('pnpm', ['install'], { cwd });
} else {
await execa(packageManager, ['install'], { cwd });
}
}

// in order to test prepare, we need to have ignore-scripts=false
// this is a security risk so we'll manually invoke install + prepare
// which is a security risk so we'll manually invoke install + prepare
await execa(packageManager, ['run', 'prepare'], { cwd });
}

Expand Down

0 comments on commit 0498e5a

Please sign in to comment.