File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
const assert = require ( 'assert' )
2
+ const nv = require ( '@pkgjs/nv' )
2
3
const { isNodeVulnerable } = require ( './index' )
3
4
4
5
async function t ( ) {
@@ -14,12 +15,14 @@ async function t () {
14
15
assert . ok ( await isNodeVulnerable ( '16.19.0' ) )
15
16
assert . ok ( await isNodeVulnerable ( '20.8.0' ) )
16
17
17
- assert . rejects ( ( ) => isNodeVulnerable ( 'lts' ) , / n o t g e t e x a c t l y o n e v e r s i o n / )
18
+ const ltsVersions = await nv ( [ 'lts' ] )
19
+ if ( ltsVersions . length > 1 ) {
20
+ assert . rejects ( ( ) => isNodeVulnerable ( 'lts' ) , / n o t g e t e x a c t l y o n e v e r s i o n / )
21
+ }
18
22
assert . rejects ( ( ) => isNodeVulnerable ( '999' ) , / n o t g e t e x a c t l y o n e v e r s i o n / )
19
23
assert . rejects ( ( ) => isNodeVulnerable ( 'Unobtanium' ) , / n o t g e t e x a c t l y o n e v e r s i o n / ) // i.e. not found
20
- assert . rejects ( ( ) => isNodeVulnerable ( '21 .0.0' ) , / n o t g e t e x a c t l y o n e v e r s i o n / )
24
+ assert . rejects ( ( ) => isNodeVulnerable ( '22 .0.0' ) , / n o t g e t e x a c t l y o n e v e r s i o n / )
21
25
22
- // EOL
23
26
// EOL
24
27
assert . ok ( await isNodeVulnerable ( '19.0.0' ) )
25
28
assert . ok ( await isNodeVulnerable ( '16.0.0' ) )
You can’t perform that action at this time.
0 commit comments