Skip to content

Commit

Permalink
Yarn Berry: add missing config key to parse yarnrc tests
Browse files Browse the repository at this point in the history
The "lockfileFilename" .yarnrc.yml option is used by Cachi2 and it also
has a default set, so it needs to be properly tested.

Signed-off-by: Bruno Pimentel <[email protected]>
  • Loading branch information
brunoapimentel committed Jan 7, 2025
1 parent 67d8657 commit a7d435c
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions tests/unit/package_managers/yarn/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
globalFolder: /a/global/folder
ignorePath: true
installStatePath: /custom/install-state.gz
lockfileFilename: custom.lock
nodeLinker: pnp
npmRegistryServer: https://registry.alternative.com
npmScopes:
Expand Down Expand Up @@ -98,6 +99,7 @@ def test_parse_yarnrc(rooted_tmp_path: RootedPath) -> None:
assert yarn_rc["globalFolder"] == "/a/global/folder"
assert yarn_rc["ignorePath"] is True
assert yarn_rc["installStatePath"] == "/custom/install-state.gz"
assert yarn_rc["lockfileFilename"] == "custom.lock"
assert yarn_rc["nodeLinker"] == "pnp"
assert yarn_rc["patchFolder"] == "/custom/patches"
assert yarn_rc["pnpDataPath"] == "/custom/.pnp.data.json"
Expand All @@ -117,26 +119,7 @@ def test_parse_empty_yarnrc(rooted_tmp_path: RootedPath) -> None:

# assert defaults are available
assert yarn_rc["cacheFolder"] == "./.yarn/cache"
assert yarn_rc["checksumBehavior"] is None
assert yarn_rc["enableGlobalCache"] is None
assert yarn_rc["enableImmutableCache"] is None
assert yarn_rc["enableImmutableInstalls"] is None
assert yarn_rc["enableMirror"] is None
assert yarn_rc["enableScripts"] is None
assert yarn_rc["enableStrictSsl"] is None
assert yarn_rc["enableTelemetry"] is None
assert yarn_rc["globalFolder"] is None
assert yarn_rc["ignorePath"] is None
assert yarn_rc["installStatePath"] is None
assert yarn_rc["nodeLinker"] is None
assert yarn_rc["patchFolder"] is None
assert yarn_rc["pnpDataPath"] is None
assert yarn_rc["pnpMode"] is None
assert yarn_rc["pnpUnpluggedFolder"] is None
assert yarn_rc["npmRegistryServer"] is None
assert yarn_rc["unsafeHttpWhitelist"] is None
assert yarn_rc["yarnPath"] is None
assert yarn_rc["virtualFolder"] is None
assert yarn_rc["lockfileFilename"] == "yarn.lock"


def test_parse_invalid_yarnrc(rooted_tmp_path: RootedPath) -> None:
Expand Down

0 comments on commit a7d435c

Please sign in to comment.