mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-27 19:41:44 -04:00
Add n/prefer-node-protocol rule and autofix all bare builtin imports to use the node: prefix. Simplify the simple-import-sort builtins pattern to just ^node: since all imports now use the prefix.
26 lines
969 B
TypeScript
26 lines
969 B
TypeScript
/// <reference path="../../../__typings__/index.d.ts"/>
|
|
import path from 'node:path'
|
|
|
|
import { assertProject } from '../src/index.js'
|
|
|
|
test('assertProject()', async () => {
|
|
const project = assertProject(path.join(import.meta.dirname, '../../..'))
|
|
|
|
project.has('rimraf')
|
|
project.hasNot('sfdsff3g34') // cspell:disable-line
|
|
expect(typeof project.requireModule('rimraf')).toBe('function')
|
|
project.isExecutable('.bin/rimraf')
|
|
})
|
|
|
|
test('assertProject() store functions', async () => {
|
|
const project = assertProject(path.join(import.meta.dirname, 'fixture/project'), 'registry.npmjs.org')
|
|
|
|
expect(typeof project.getStorePath()).toBe('string')
|
|
project.storeHas('is-positive', '3.1.0')
|
|
expect(typeof project.resolve('is-positive', '3.1.0')).toBe('string')
|
|
project.storeHasNot('is-positive', '3.100.0')
|
|
expect(project.readLockfile()).toBeTruthy()
|
|
expect(project.readCurrentLockfile()).toBeTruthy()
|
|
expect(project.readModulesManifest()).toBeTruthy()
|
|
})
|