Skip to content

Commit 0e528f2

Browse files
TrevorBurnhamowlstronaut
authored andcommitted
chore: add load-virtual and reify tests for workspace override test coverage
1 parent 1642556 commit 0e528f2

File tree

11 files changed

+228
-675
lines changed

11 files changed

+228
-675
lines changed

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

Lines changed: 0 additions & 231 deletions
Original file line numberDiff line numberDiff line change
@@ -6161,237 +6161,6 @@ ArboristNode {
61616161
}
61626162
`
61636163

6164-
exports[`test/arborist/load-actual.js TAP selflink > loaded tree 1`] = `
6165-
ArboristNode {
6166-
"children": Map {
6167-
"@scope/y" => ArboristNode {
6168-
"edgesIn": Set {
6169-
EdgeIn {
6170-
"from": "",
6171-
"name": "@scope/y",
6172-
"spec": "*",
6173-
"type": "prod",
6174-
},
6175-
},
6176-
"edgesOut": Map {
6177-
"foo" => EdgeOut {
6178-
"name": "foo",
6179-
"spec": "*",
6180-
"to": "node_modules/foo",
6181-
"type": "prod",
6182-
},
6183-
},
6184-
"location": "node_modules/@scope/y",
6185-
"name": "@scope/y",
6186-
"path": "selflink/node_modules/@scope/y",
6187-
"version": "1.2.3",
6188-
},
6189-
"@scope/z" => ArboristNode {
6190-
"children": Map {
6191-
"glob" => ArboristLink {
6192-
"dev": true,
6193-
"edgesIn": Set {
6194-
EdgeIn {
6195-
"from": "node_modules/@scope/z",
6196-
"name": "glob",
6197-
"spec": "4",
6198-
"type": "prod",
6199-
},
6200-
},
6201-
"extraneous": true,
6202-
"location": "node_modules/@scope/z/node_modules/glob",
6203-
"name": "glob",
6204-
"optional": true,
6205-
"path": "selflink/node_modules/@scope/z/node_modules/glob",
6206-
"peer": true,
6207-
"realpath": "selflink/node_modules/foo/node_modules/glob",
6208-
"resolved": "file:../../../foo/node_modules/glob",
6209-
"target": ArboristNode {
6210-
"children": Map {
6211-
"graceful-fs" => ArboristNode {
6212-
"dev": true,
6213-
"extraneous": true,
6214-
"location": "node_modules/foo/node_modules/glob/node_modules/graceful-fs",
6215-
"name": "graceful-fs",
6216-
"optional": true,
6217-
"path": "selflink/node_modules/foo/node_modules/glob/node_modules/graceful-fs",
6218-
"peer": true,
6219-
"version": "3.0.2",
6220-
},
6221-
"inherits" => ArboristNode {
6222-
"dev": true,
6223-
"extraneous": true,
6224-
"location": "node_modules/foo/node_modules/glob/node_modules/inherits",
6225-
"name": "inherits",
6226-
"optional": true,
6227-
"path": "selflink/node_modules/foo/node_modules/glob/node_modules/inherits",
6228-
"peer": true,
6229-
"version": "2.0.1",
6230-
},
6231-
"minimatch" => ArboristNode {
6232-
"children": Map {
6233-
"lru-cache" => ArboristNode {
6234-
"dev": true,
6235-
"extraneous": true,
6236-
"location": "node_modules/foo/node_modules/glob/node_modules/minimatch/node_modules/lru-cache",
6237-
"name": "lru-cache",
6238-
"optional": true,
6239-
"path": "selflink/node_modules/foo/node_modules/glob/node_modules/minimatch/node_modules/lru-cache",
6240-
"peer": true,
6241-
"version": "2.5.0",
6242-
},
6243-
"sigmund" => ArboristNode {
6244-
"dev": true,
6245-
"extraneous": true,
6246-
"location": "node_modules/foo/node_modules/glob/node_modules/minimatch/node_modules/sigmund",
6247-
"name": "sigmund",
6248-
"optional": true,
6249-
"path": "selflink/node_modules/foo/node_modules/glob/node_modules/minimatch/node_modules/sigmund",
6250-
"peer": true,
6251-
"version": "1.0.0",
6252-
},
6253-
},
6254-
"dev": true,
6255-
"extraneous": true,
6256-
"location": "node_modules/foo/node_modules/glob/node_modules/minimatch",
6257-
"name": "minimatch",
6258-
"optional": true,
6259-
"path": "selflink/node_modules/foo/node_modules/glob/node_modules/minimatch",
6260-
"peer": true,
6261-
"version": "1.0.0",
6262-
},
6263-
"once" => ArboristNode {
6264-
"dev": true,
6265-
"extraneous": true,
6266-
"location": "node_modules/foo/node_modules/glob/node_modules/once",
6267-
"name": "once",
6268-
"optional": true,
6269-
"path": "selflink/node_modules/foo/node_modules/glob/node_modules/once",
6270-
"peer": true,
6271-
"version": "1.3.0",
6272-
},
6273-
},
6274-
"edgesIn": Set {
6275-
EdgeIn {
6276-
"from": "node_modules/foo",
6277-
"name": "glob",
6278-
"spec": "4",
6279-
"type": "prod",
6280-
},
6281-
},
6282-
"location": "node_modules/foo/node_modules/glob",
6283-
"name": "glob",
6284-
"path": "selflink/node_modules/foo/node_modules/glob",
6285-
"version": "4.0.5",
6286-
},
6287-
"version": "4.0.5",
6288-
},
6289-
},
6290-
"dev": true,
6291-
"edgesOut": Map {
6292-
"glob" => EdgeOut {
6293-
"name": "glob",
6294-
"spec": "4",
6295-
"to": "node_modules/@scope/z/node_modules/glob",
6296-
"type": "prod",
6297-
},
6298-
},
6299-
"extraneous": true,
6300-
"location": "node_modules/@scope/z",
6301-
"name": "@scope/z",
6302-
"optional": true,
6303-
"path": "selflink/node_modules/@scope/z",
6304-
"peer": true,
6305-
"version": "1.2.3",
6306-
},
6307-
"foo" => ArboristNode {
6308-
"children": Map {
6309-
"glob" => ArboristNode {
6310-
"location": "node_modules/foo/node_modules/glob",
6311-
},
6312-
"selflink" => ArboristLink {
6313-
"edgesIn": Set {
6314-
EdgeIn {
6315-
"from": "node_modules/foo",
6316-
"name": "selflink",
6317-
"spec": "*",
6318-
"type": "prod",
6319-
},
6320-
},
6321-
"location": "node_modules/foo/node_modules/selflink",
6322-
"name": "selflink",
6323-
"path": "selflink/node_modules/foo/node_modules/selflink",
6324-
"realpath": "selflink",
6325-
"resolved": "file:../../..",
6326-
"target": ArboristNode {
6327-
"location": "",
6328-
},
6329-
"version": "1.2.3",
6330-
},
6331-
},
6332-
"edgesIn": Set {
6333-
EdgeIn {
6334-
"from": "",
6335-
"name": "foo",
6336-
"spec": "*",
6337-
"type": "prod",
6338-
},
6339-
EdgeIn {
6340-
"from": "node_modules/@scope/y",
6341-
"name": "foo",
6342-
"spec": "*",
6343-
"type": "prod",
6344-
},
6345-
},
6346-
"edgesOut": Map {
6347-
"glob" => EdgeOut {
6348-
"name": "glob",
6349-
"spec": "4",
6350-
"to": "node_modules/foo/node_modules/glob",
6351-
"type": "prod",
6352-
},
6353-
"selflink" => EdgeOut {
6354-
"name": "selflink",
6355-
"spec": "*",
6356-
"to": "node_modules/foo/node_modules/selflink",
6357-
"type": "prod",
6358-
},
6359-
},
6360-
"location": "node_modules/foo",
6361-
"name": "foo",
6362-
"path": "selflink/node_modules/foo",
6363-
"version": "1.2.3",
6364-
},
6365-
},
6366-
"edgesOut": Map {
6367-
"@scope/x" => EdgeOut {
6368-
"error": "MISSING",
6369-
"name": "@scope/x",
6370-
"spec": "*",
6371-
"to": null,
6372-
"type": "prod",
6373-
},
6374-
"@scope/y" => EdgeOut {
6375-
"name": "@scope/y",
6376-
"spec": "*",
6377-
"to": "node_modules/@scope/y",
6378-
"type": "prod",
6379-
},
6380-
"foo" => EdgeOut {
6381-
"name": "foo",
6382-
"spec": "*",
6383-
"to": "node_modules/foo",
6384-
"type": "prod",
6385-
},
6386-
},
6387-
"isProjectRoot": true,
6388-
"location": "",
6389-
"name": "selflink",
6390-
"path": "selflink",
6391-
"version": "1.2.3",
6392-
}
6393-
`
6394-
63956164
exports[`test/arborist/load-actual.js TAP shake out Link target timing issue > loaded tree 1`] = `
63966165
ArboristNode {
63976166
"children": Map {

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

Lines changed: 83 additions & 0 deletions
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

Lines changed: 33 additions & 0 deletions
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)