Skip to content

Commit

Permalink
Update test expectations: it was testing an impossible scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlewis committed May 31, 2022
1 parent 0c3570a commit 0aea268
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions test/run
Original file line number Diff line number Diff line change
Expand Up @@ -253,23 +253,13 @@ testYarn() {
assertCapturedSuccess
}

testYarnCacheDirectory() {
testYarnCache() {
local cache=$(mktmpdir)
local env_dir=$(mktmpdir)
local cache_dir=$(mktmpdir)
echo "${cache_dir}/yarn"> "$env_dir/YARN_CACHE_FOLDER"
compile "yarn" $cache $env_dir
# These will be created if yarn is using the directory for its cache

assertDirectoryExists ${cache_dir}/yarn
# yarn frequently bumps the version number used in its cache
# so use a wildcard here to prevent frequent CI failures

# assert that the above ls command exited successfully, which only happens if the file exists
assertEquals "0" "$?"
compile "yarn" $cache

# assert that devDependencies are cached
assertEquals "1" "$(ls -1 $cache/node/cache/node_modules | grep -c debug | tr -d ' ')"
assertEquals "1" "$(ls -1 $cache/node/cache/yarn/v6 | grep -c debug | tr -d ' ')"

assertCapturedSuccess
}
Expand Down

0 comments on commit 0aea268

Please sign in to comment.