mirror of
https://github.com/pnpm/pnpm.git
synced 2026-07-25 23:17:08 -04:00
18 lines
661 B
TypeScript
18 lines
661 B
TypeScript
import { MANIFEST_BASE_NAMES } from '@pnpm/constants'
|
|
import { prepareEmpty } from '@pnpm/prepare'
|
|
import { writeProjectManifest } from '@pnpm/write-project-manifest'
|
|
import { statManifestFile } from '../src/statManifestFile.js'
|
|
|
|
test.each(MANIFEST_BASE_NAMES)('load %s', async baseName => {
|
|
prepareEmpty()
|
|
await writeProjectManifest(`foo/bar/${baseName}`, { name: 'foo', version: '1.0.0' })
|
|
const stats = await statManifestFile('foo/bar')
|
|
expect(stats).toBeDefined()
|
|
expect(stats?.isFile()).toBe(true)
|
|
})
|
|
|
|
test('should return undefined if no manifest is found', async () => {
|
|
prepareEmpty()
|
|
expect(await statManifestFile('.')).toBeUndefined()
|
|
})
|