Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Primajin committed Feb 11, 2022
1 parent 3873911 commit dc6451a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/types.ts
Expand Up @@ -142,9 +142,9 @@ export interface RunOptions {
errorLevel?: number,

/**
* Include only package names matching the given string, wildcard, glob, comma-or-space-delimited list, or /regex/.
* Include only package names matching the given string, wildcard, glob, comma-or-space-delimited list, /regex/ or function that returns true.
*/
filter?: string | string[] | RegExp | RegExp[],
filter?: FilterPattern,

/**
* Filter on package version using comma-or-space-delimited list, or /regex/.
Expand Down
7 changes: 7 additions & 0 deletions test/getCurrentDependencies.test.ts
Expand Up @@ -138,6 +138,13 @@ describe('getCurrentDependencies', () => {
'@ngrx/store': '4.0.0'
})
})

it('filter dependencies by function', () => {
getCurrentDependencies(deps, { filter: (s:string) => s.startsWith('m') }).should.eql({
mocha: '1.2',
moment: '^1.0.0'
})
})
})

describe('reject', () => {
Expand Down

0 comments on commit dc6451a

Please sign in to comment.