mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-11 17:42:43 -04:00
* chore: manifest-utils to jest * chore: matcher to jest * chore: modules-yaml to jest * chore: npm-registry-agent to jest Replaced `proxyquire` with jest mocking Fixed `OPTS.strictSSL` fixture to be a boolean as that's what the agent's option type expects. `npm-registry-agent` self-links as a devDependency for importing PR #2913 ref #2858
34 lines
811 B
TypeScript
34 lines
811 B
TypeScript
import matcher from '@pnpm/matcher'
|
|
|
|
test('matcher()', () => {
|
|
{
|
|
const match = matcher('*')
|
|
expect(match('@eslint/plugin-foo')).toBe(true)
|
|
expect(match('express')).toBe(true)
|
|
}
|
|
{
|
|
const match = matcher(['eslint-*'])
|
|
expect(match('eslint-plugin-foo')).toBe(true)
|
|
expect(match('express')).toBe(false)
|
|
}
|
|
{
|
|
const match = matcher(['*plugin*'])
|
|
expect(match('@eslint/plugin-foo')).toBe(true)
|
|
expect(match('express')).toBe(false)
|
|
}
|
|
{
|
|
const match = matcher(['a*c'])
|
|
expect(match('abc')).toBe(true)
|
|
}
|
|
{
|
|
const match = matcher(['*-positive'])
|
|
expect(match('is-positive')).toBe(true)
|
|
}
|
|
{
|
|
const match = matcher(['foo', 'bar'])
|
|
expect(match('foo')).toBe(true)
|
|
expect(match('bar')).toBe(true)
|
|
expect(match('express')).toBe(false)
|
|
}
|
|
})
|