Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
workspaces wip: hoist shared deps snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
ruyadorno committed Mar 12, 2020
1 parent f4cd2ad commit 4a3608c
Show file tree
Hide file tree
Showing 3 changed files with 157 additions and 3 deletions.
154 changes: 154 additions & 0 deletions tap-snapshots/test-arborist-build-ideal-tree.js-TAP.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46267,3 +46267,157 @@ Node {
"resolved": null,
}
`

exports[`test/arborist/build-ideal-tree.js TAP workspaces should install shared dependencies into root folder > expect resolving Promise 1`] = `
Node {
"children": Map {
"a" => Link {
"edgesIn": Set {
Edge {
"from": "",
"name": "a",
"spec": "file:{CWD}/test/fixtures/workspaces-shared-deps/packages/a",
"type": "workspace",
},
},
"location": "node_modules/a",
"name": "a",
"resolved": "file:../packages/a",
"target": Object {
"name": "a",
"parent": null,
},
},
"abbrev" => Node {
"edgesIn": Set {
Edge {
"from": "packages/a",
"name": "abbrev",
"spec": "^1.1.1",
"type": "prod",
},
Edge {
"from": "packages/b",
"name": "abbrev",
"spec": "^1.1.1",
"type": "prod",
},
},
"location": "node_modules/abbrev",
"name": "abbrev",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
},
"b" => Link {
"edgesIn": Set {
Edge {
"from": "",
"name": "b",
"spec": "file:{CWD}/test/fixtures/workspaces-shared-deps/packages/b",
"type": "workspace",
},
},
"location": "node_modules/b",
"name": "b",
"resolved": "file:../packages/b",
"target": Object {
"name": "b",
"parent": null,
},
},
"c" => Link {
"edgesIn": Set {
Edge {
"from": "",
"name": "c",
"spec": "file:{CWD}/test/fixtures/workspaces-shared-deps/packages/c",
"type": "workspace",
},
},
"location": "node_modules/c",
"name": "c",
"resolved": "file:../packages/c",
"target": Object {
"name": "c",
"parent": null,
},
},
"uuid" => Node {
"edgesIn": Set {
Edge {
"from": "packages/c",
"name": "uuid",
"spec": "=3.3.3",
"type": "prod",
},
},
"location": "node_modules/uuid",
"name": "uuid",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
},
},
"edgesOut": Map {
"a" => Edge {
"name": "a",
"spec": "file:{CWD}/test/fixtures/workspaces-shared-deps/packages/a",
"to": "node_modules/a",
"type": "workspace",
},
"b" => Edge {
"name": "b",
"spec": "file:{CWD}/test/fixtures/workspaces-shared-deps/packages/b",
"to": "node_modules/b",
"type": "workspace",
},
"c" => Edge {
"name": "c",
"spec": "file:{CWD}/test/fixtures/workspaces-shared-deps/packages/c",
"to": "node_modules/c",
"type": "workspace",
},
},
"fsChildren": Set {
Node {
"edgesOut": Map {
"abbrev" => Edge {
"name": "abbrev",
"spec": "^1.1.1",
"to": "node_modules/abbrev",
"type": "prod",
},
},
"location": "packages/a",
"name": "a",
"resolved": null,
},
Node {
"edgesOut": Map {
"abbrev" => Edge {
"name": "abbrev",
"spec": "^1.1.1",
"to": "node_modules/abbrev",
"type": "prod",
},
},
"location": "packages/b",
"name": "b",
"resolved": null,
},
Node {
"edgesOut": Map {
"uuid" => Edge {
"name": "uuid",
"spec": "=3.3.3",
"to": "node_modules/uuid",
"type": "prod",
},
},
"location": "packages/c",
"name": "c",
"resolved": null,
},
},
"location": "",
"name": "workspaces-shared-deps",
"resolved": null,
}
`
4 changes: 2 additions & 2 deletions test/arborist/build-ideal-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -886,9 +886,9 @@ t.test('workspaces', t => {
return t.rejects(printIdeal(path), { code: 'EDUPLICATEWORKSPACE' }, 'throws EDUPLICATEWORKSPACE error')
})

t.skip('should install shared dependencies into root folder', t => {
t.test('should install shared dependencies into root folder', t => {
const path = resolve(__dirname, '../fixtures/workspaces-shared-deps')
return printIdeal(path).then(console.log)
return t.resolveMatchSnapshot(printIdeal(path))
})

t.skip('should install conflicting dep versions', t => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "c",
"version": "1.0.0",
"dependencies": {
"test-package": "=0.0.1"
"uuid": "=3.3.3"
}
}

0 comments on commit 4a3608c

Please sign in to comment.