Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornlf <quitlahok@gmail.com>2022-04-14 19:57:54 +0300
committernlf <quitlahok@gmail.com>2022-04-14 21:31:55 +0300
commiteb0817f751eed4595e1e3d8b938e1a4849064a99 (patch)
treeb3ffbf9c9e3c1ddf52f7dbbe5eaf955e66530eee
parent42fdd79fcac1d864136b5671f62cd7030b4fb54e (diff)
chore(arborist): add installLinks with workspaces test
-rw-r--r--workspaces/arborist/test/arborist/reify.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/workspaces/arborist/test/arborist/reify.js b/workspaces/arborist/test/arborist/reify.js
index 813c984ce..509700404 100644
--- a/workspaces/arborist/test/arborist/reify.js
+++ b/workspaces/arborist/test/arborist/reify.js
@@ -2815,5 +2815,53 @@ t.test('installLinks', (t) => {
t.ok(abbrev.isDirectory(), 'abbrev got installed')
})
+ t.test('workspaces are always symlinks, even with installLinks set to true', async (t) => {
+ const path = t.testdir({
+ a: {
+ 'package.json': JSON.stringify({
+ name: 'a',
+ version: '1.0.0',
+ main: 'index.js',
+ dependencies: {
+ b: 'file:../b',
+ c: '^1.0.0',
+ },
+ workspaces: ['./c'],
+ }),
+ 'index.js': '',
+ c: {
+ 'package.json': JSON.stringify({
+ name: 'c',
+ version: '1.0.0',
+ main: 'index.js',
+ }),
+ 'index.js': '',
+ },
+ },
+ b: {
+ 'package.json': JSON.stringify({
+ name: 'b',
+ version: '1.0.0',
+ main: 'index.js',
+ dependencies: {
+ abbrev: '^1.0.0',
+ },
+ }),
+ 'index.js': '',
+ },
+ })
+
+ await reify(resolve(path, 'a'), { installLinks: true })
+
+ const installedB = fs.lstatSync(resolve(path, 'a/node_modules/b'))
+ t.ok(installedB.isDirectory(), 'a/node_modules/b is a directory')
+
+ const installedC = fs.lstatSync(resolve(path, 'a/node_modules/c'))
+ t.ok(installedC.isSymbolicLink(), 'a/node_modules/c is a symlink')
+
+ const abbrev = fs.lstatSync(resolve(path, 'a/node_modules/abbrev'))
+ t.ok(abbrev.isDirectory(), 'abbrev got installed')
+ })
+
t.end()
})