diff options
author | nlf <quitlahok@gmail.com> | 2022-04-14 19:57:54 +0300 |
---|---|---|
committer | Luke Karrys <luke@lukekarrys.com> | 2022-04-20 02:22:20 +0300 |
commit | a4adf256b4fc268fc64cfd5e66526b4685716e79 (patch) | |
tree | 51dff3a6a35f619d0fb81472cb5e474db86fe103 /workspaces/arborist | |
parent | 0ebadf5b603368557e9e837a46ea5c59c2677a81 (diff) |
chore(arborist): add installLinks with workspaces test
Diffstat (limited to 'workspaces/arborist')
-rw-r--r-- | workspaces/arborist/test/arborist/reify.js | 48 |
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() }) |