mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-28 09:38:07 -05:00
27 lines
450 B
TypeScript
27 lines
450 B
TypeScript
import { run } from '@pnpm/plugin-commands-script-runners'
|
|
import { prepare } from '@pnpm/prepare'
|
|
|
|
test('run completion', async () => {
|
|
prepare({
|
|
scripts: {
|
|
lint: 'eslint',
|
|
test: 'node test.js',
|
|
},
|
|
})
|
|
|
|
expect(
|
|
await run.completion({}, [])
|
|
).toStrictEqual(
|
|
[
|
|
{
|
|
name: 'lint',
|
|
},
|
|
{
|
|
name: 'test',
|
|
},
|
|
]
|
|
)
|
|
|
|
expect(await run.completion({}, ['test'])).toStrictEqual([])
|
|
})
|