Skip to content

Commit

Permalink
chore: add test to simulate null target link
Browse files Browse the repository at this point in the history
  • Loading branch information
GiveMeSomething committed Jun 16, 2024
1 parent eb982f4 commit 2ab308c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions workspaces/arborist/test/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const { resolve } = require('node:path')
const treeCheck = require('../lib/tree-check.js')

const { normalizePath, normalizePaths } = require('./fixtures/utils.js')
const { realpath } = require('node:fs')

Check failure on line 11 in workspaces/arborist/test/node.js

View workflow job for this annotation

GitHub Actions / Lint

'realpath' is assigned a value but never used

t.cleanSnapshot = str =>
str.split(process.cwd()).join('{CWD}')
Expand Down Expand Up @@ -1548,6 +1549,13 @@ t.test('detect that two nodes are the same thing', async t => {
const b = new Node({ parent: a, pkg: pkgb })
check(a, b, false, 'name/version mismatch, if no resolved/integrity')
}

{
const root = new Node({ path: '/x' })
const a = new Link({ root, path: '/a', realpath: '/a', target: null })
const b = new Link({ root, path: '/b', realpath: '/b', target: null })
check(a, b, false, 'links does not match if target to null')
}
})

t.test('node.satisfies(requested)', t => {
Expand Down

0 comments on commit 2ab308c

Please sign in to comment.