Skip to content

Commit c3b73f3

Browse files
author
Charan Sarin
committed
Set yarn test config in individual fixture folders; restored original yarnInstall method.
1 parent 0b6fd4f commit c3b73f3

File tree

15 files changed

+23
-11
lines changed

15 files changed

+23
-11
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
/coverage
55
/.eslintcache
66
/.dccache
7-
/test/_yarn_cache

bin/cli-install.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,7 @@ const ensureGitClone = async (remote, local) => {
5757
*/
5858
const yarnInstall = (local) => {
5959
const dir = absoluteRepoPath(local)
60-
/* c8 ignore start */
61-
const args = process.env.TAP
62-
? [
63-
'install',
64-
'--offline',
65-
`--cache-folder ../../../../_yarn_cache/.yarn_${process.env.TAP_CHILD_ID}`
66-
]
67-
: ['install']
68-
/* c8 ignore stop */
69-
return run('yarn', args, dir)
60+
return run('yarn', ['install'], dir)
7061
}
7162

7263
/**

test/_fixtures/addrepos/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.yarn_cache

test/_fixtures/addrepos/.yarnrc

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
yarn-offline-mirror "../../npm-packages-offline-cache"
22
yarn-offline-mirror-pruning true
3+
--cache-folder ./.yarn_cache
4+
--offline

test/_fixtures/empty/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.yarn_cache

test/_fixtures/empty/.yarnrc

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
yarn-offline-mirror "../../npm-packages-offline-cache"
22
yarn-offline-mirror-pruning true
3+
--cache-folder ./.yarn_cache
4+
--offline

test/_fixtures/listrepos/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.yarn_cache

test/_fixtures/listrepos/.yarnrc

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
yarn-offline-mirror "../../npm-packages-offline-cache"
22
yarn-offline-mirror-pruning true
3+
--cache-folder ./.yarn_cache
4+
--offline

test/_fixtures/norepos/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.yarn_cache

test/_fixtures/norepos/.yarnrc

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
yarn-offline-mirror "../../npm-packages-offline-cache"
22
yarn-offline-mirror-pruning true
3+
--cache-folder ./.yarn_cache
4+
--offline

test/_fixtures/pullrepos/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.yarn_cache

test/_fixtures/pullrepos/.yarnrc

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
yarn-offline-mirror "../../npm-packages-offline-cache"
22
yarn-offline-mirror-pruning true
3+
--cache-folder ./.yarn_cache
4+
--offline

test/_fixtures/runrepos/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.yarn_cache

test/_fixtures/runrepos/.yarnrc

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
yarn-offline-mirror "../../npm-packages-offline-cache"
22
yarn-offline-mirror-pruning true
3+
--cache-folder ./.yarn_cache
4+
--offline

test/helper.js

+4
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,15 @@ export const cleanupGit = (testPhase = 'install') => {
4242
if (testPhase === 'install') {
4343
fs.removeSync(path.resolve(__dirname, './_stubs/demorepo/.git'))
4444
fs.removeSync(path.resolve(__dirname, `./_fixtures/addrepos/repos`))
45+
fs.removeSync(path.resolve(__dirname, `./_fixtures/addrepos/.yarn_cache`))
4546
return
4647
}
4748

4849
fs.removeSync(path.resolve(__dirname, `./_stubs/demorepo_${testPhase}/.git`))
4950
fs.removeSync(path.resolve(__dirname, `./_fixtures/${testPhase}repos/repos`))
51+
fs.removeSync(
52+
path.resolve(__dirname, `./_fixtures/${testPhase}repos/.yarn_cache`)
53+
)
5054
}
5155

5256
export const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms))

0 commit comments

Comments
 (0)