Skip to content

Commit

Permalink
fix(test): Ensure that yarn is installed
Browse files Browse the repository at this point in the history
  • Loading branch information
Morten N.O. Henriksen committed Nov 27, 2021
1 parent 96ce05c commit d10442b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
cache: 'npm'
- name: Install npm@7
run: npm i -g npm@7
- name: Install yarn
run: npm i -g yarn
- name: Install packages
run: npm ci --prefer-offline
- name: Run integration tests
Expand Down
10 changes: 6 additions & 4 deletions test/integration/create-react-app/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ const run = (args, options) => execa('node', [cli].concat(args), options);
const genFileExists = f => existsSync(join(genPath, f));

describe('create-react-app', () => {
it('check yarn installation', async () => {
// Assert that yarn is installed
const { exitCode } = await execa('yarn --version');
expect(exitCode).toBe(0);
});

it('asks to supply an argument if none supplied', async () => {
const { exitCode, stderr } = await run([], { reject: false });

Expand Down Expand Up @@ -89,10 +95,6 @@ describe('create-react-app', () => {
});

it('uses yarn as the package manager', async () => {
// Assert that yarn is installed
const yarnVersionResult = await execa('yarn --version');
expect(yarnVersionResult.exitCode).toBe(0);

const { exitCode } = await run([projectName], {
cwd: __dirname,
env: { npm_config_user_agent: 'yarn' },
Expand Down

0 comments on commit d10442b

Please sign in to comment.