How to use the supi.unlinkPkgs function in supi

To help you get started, we’ve selected a few supi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pnpm / pnpm / test / unlink.ts View on Github external
await addDistTag('foo', '100.0.0', 'latest')
  const opts = await testDefaults({prefix: process.cwd()})
  await installPkgs(['foo'], opts)

  process.chdir('..')

  await writeJsonFile('foo/package.json', {
    name: 'foo',
    version: '100.0.0',
  })

  await link(['foo'], path.join('project', 'node_modules'), opts)
  await addDistTag('foo', '100.1.0', 'latest')

  process.chdir('project')
  await unlinkPkgs(['foo'], opts)

  t.equal(project.requireModule('foo/package.json').version, '100.0.0', 'foo not updated after unlink')
})