Skip to content

Commit 4005b4c

Browse files
authored
Use yarn instead of npm when a yarn.lock file exists (#125)
Autoprefixer had a yarn.lock, particularly to pin the caniuse dependency, but we were using npm, so it wasn't being respected and an upgrade broke tests. Now we install with yarn if we see a yarn.lock so that tests are more reliable.
1 parent 7ea1007 commit 4005b4c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/cli.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,12 @@ async function runTests(config) {
265265
await run(command);
266266
}
267267
} else {
268-
await run('npm install');
268+
if (await exists('./yarn.lock')) {
269+
await run('npm install -g yarn');
270+
await run('yarn');
271+
} else {
272+
await run('npm install');
273+
}
269274
await run('npm test');
270275
}
271276
return 'PASSED';

0 commit comments

Comments
 (0)