Skip to content

Commit 88a7b52

Browse files
chore: add load-virtual and reify tests for workspace override test coverage (#8174)
Related: #8108 This adds test coverage for workspace override functionality Co-authored-by: Trevor Burnham <[email protected]>
1 parent 14efa57 commit 88a7b52

File tree

10 files changed

+303
-369
lines changed

10 files changed

+303
-369
lines changed

workspaces/arborist/tap-snapshots/test/arborist/load-virtual.js.test.cjs

+83
Original file line numberDiff line numberDiff line change
@@ -16375,6 +16375,89 @@ ArboristNode {
1637516375
}
1637616376
`
1637716377

16378+
exports[`test/arborist/load-virtual.js TAP workspaces load installed workspace with dependency overrides > virtual tree with overrides 1`] = `
16379+
ArboristNode {
16380+
"children": Map {
16381+
"arg" => ArboristNode {
16382+
"edgesIn": Set {
16383+
EdgeIn {
16384+
"error": "INVALID",
16385+
"from": "ws",
16386+
"name": "arg",
16387+
"spec": "4.1.2",
16388+
"type": "prod",
16389+
},
16390+
},
16391+
"location": "node_modules/arg",
16392+
"name": "arg",
16393+
"path": "{CWD}/test/fixtures/workspaces-with-overrides/node_modules/arg",
16394+
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
16395+
"version": "4.1.3",
16396+
},
16397+
"ws" => ArboristLink {
16398+
"edgesIn": Set {
16399+
EdgeIn {
16400+
"from": "",
16401+
"name": "ws",
16402+
"spec": "file:{CWD}/test/fixtures/workspaces-with-overrides/ws",
16403+
"type": "workspace",
16404+
},
16405+
},
16406+
"isWorkspace": true,
16407+
"location": "node_modules/ws",
16408+
"name": "ws",
16409+
"overrides": Map {
16410+
"arg" => "4.1.3",
16411+
},
16412+
"path": "{CWD}/test/fixtures/workspaces-with-overrides/node_modules/ws",
16413+
"realpath": "{CWD}/test/fixtures/workspaces-with-overrides/ws",
16414+
"resolved": "file:../ws",
16415+
"target": ArboristNode {
16416+
"location": "ws",
16417+
},
16418+
"version": "1.0.0",
16419+
},
16420+
},
16421+
"edgesOut": Map {
16422+
"ws" => EdgeOut {
16423+
"name": "ws",
16424+
"spec": "file:{CWD}/test/fixtures/workspaces-with-overrides/ws",
16425+
"to": "node_modules/ws",
16426+
"type": "workspace",
16427+
},
16428+
},
16429+
"fsChildren": Set {
16430+
ArboristNode {
16431+
"edgesOut": Map {
16432+
"arg" => EdgeOut {
16433+
"error": "INVALID",
16434+
"name": "arg",
16435+
"spec": "4.1.2",
16436+
"to": "node_modules/arg",
16437+
"type": "prod",
16438+
},
16439+
},
16440+
"isWorkspace": true,
16441+
"location": "ws",
16442+
"name": "ws",
16443+
"path": "{CWD}/test/fixtures/workspaces-with-overrides/ws",
16444+
"version": "1.0.0",
16445+
},
16446+
},
16447+
"isProjectRoot": true,
16448+
"location": "",
16449+
"name": "workspaces-with-overrides",
16450+
"overrides": Map {
16451+
"arg" => "4.1.3",
16452+
},
16453+
"packageName": "workspace-with-overrides",
16454+
"path": "{CWD}/test/fixtures/workspaces-with-overrides",
16455+
"workspaces": Map {
16456+
"ws" => "ws",
16457+
},
16458+
}
16459+
`
16460+
1637816461
exports[`test/arborist/load-virtual.js TAP workspaces load installed workspace with transitive dependencies > virtual tree with transitive deps 1`] = `
1637916462
ArboristNode {
1638016463
"children": Map {

workspaces/arborist/tap-snapshots/test/arborist/reify.js.test.cjs

+33
Original file line numberDiff line numberDiff line change
@@ -53497,6 +53497,39 @@ Object {
5349753497
}
5349853498
`
5349953499

53500+
exports[`test/arborist/reify.js TAP workspaces reify workspaces with overrides > should retain override version (4.1.3) 1`] = `
53501+
Object {
53502+
"lockfileVersion": 3,
53503+
"name": "workspace-with-overrides",
53504+
"packages": Object {
53505+
"": Object {
53506+
"name": "workspace-with-overrides",
53507+
"workspaces": Array [
53508+
"ws",
53509+
],
53510+
},
53511+
"node_modules/a": Object {
53512+
"link": true,
53513+
"resolved": "ws",
53514+
},
53515+
"node_modules/arg": Object {
53516+
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
53517+
"license": "MIT",
53518+
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
53519+
"version": "4.1.3",
53520+
},
53521+
"ws": Object {
53522+
"dependencies": Object {
53523+
"arg": "4.1.2",
53524+
},
53525+
"name": "a",
53526+
"version": "1.0.0",
53527+
},
53528+
},
53529+
"requires": true,
53530+
}
53531+
`
53532+
5350053533
exports[`test/arborist/reify.js TAP workspaces root as-a-workspace > should produce expected package-lock file 1`] = `
5350153534
Object {
5350253535
"lockfileVersion": 3,

0 commit comments

Comments
 (0)