@@ -4,7 +4,7 @@ import assert from "node:assert";
44
55// Import Internal Dependencies
66import {
7- kHttpClientHeaders ,
7+ HTTP_CLIENT_HEADERS ,
88 setupHttpAgentMock
99} from "../strategies/utils.js" ;
1010import { nvd } from "../../src/database/index.js" ;
@@ -29,7 +29,7 @@ describe("nvd", () => {
2929 path : `${ new URL ( nvd . ROOT_API ) . pathname } ?${ queryString } ` ,
3030 method : "GET"
3131 } )
32- . reply ( 200 , expectedResponse , kHttpClientHeaders ) ;
32+ . reply ( 200 , expectedResponse , HTTP_CLIENT_HEADERS ) ;
3333
3434 const vulns = await nvd . findOne ( {
3535 packageName : "express" ,
@@ -39,7 +39,7 @@ describe("nvd", () => {
3939 assert . deepStrictEqual ( vulns , expectedResponse . vulnerabilities ) ;
4040 } ) ;
4141
42- test ( ` should send a GET http request with severity parameter` , async ( ) => {
42+ test ( " should send a GET http request with severity parameter" , async ( ) => {
4343 const expectedResponse = { vulnerabilities : [ "cve-data-1" ] } ;
4444 const params = new URLSearchParams ( ) ;
4545 params . append ( "keywordSearch" , "express" ) ;
@@ -51,7 +51,7 @@ describe("nvd", () => {
5151 path : `${ new URL ( nvd . ROOT_API ) . pathname } ?${ queryString } ` ,
5252 method : "GET"
5353 } )
54- . reply ( 200 , expectedResponse , kHttpClientHeaders ) ;
54+ . reply ( 200 , expectedResponse , HTTP_CLIENT_HEADERS ) ;
5555
5656 const vulns = await nvd . findOne ( {
5757 packageName : "express" ,
@@ -62,7 +62,7 @@ describe("nvd", () => {
6262 assert . deepStrictEqual ( vulns , expectedResponse . vulnerabilities ) ;
6363 } ) ;
6464
65- test ( ` should send a GET http request to the NVD API using findOneBySpec` , async ( ) => {
65+ test ( " should send a GET http request to the NVD API using findOneBySpec" , async ( ) => {
6666 const expectedResponse = { vulnerabilities : [ "cve-data-1" , "cve-data-2" ] } ;
6767 const packageName = "express" ;
6868 const params = new URLSearchParams ( ) ;
@@ -74,13 +74,13 @@ describe("nvd", () => {
7474 path : `${ new URL ( nvd . ROOT_API ) . pathname } ?${ queryString } ` ,
7575 method : "GET"
7676 } )
77- . reply ( 200 , expectedResponse , kHttpClientHeaders ) ;
77+ . reply ( 200 , expectedResponse , HTTP_CLIENT_HEADERS ) ;
7878
7979 const vulns = await nvd . findOneBySpec ( `${ packageName } @1.0.0` ) ;
8080 assert . deepStrictEqual ( vulns , expectedResponse . vulnerabilities ) ;
8181 } ) ;
8282
83- test ( ` should send multiple GET http requests to the NVD API using findMany` , async ( ) => {
83+ test ( " should send multiple GET http requests to the NVD API using findMany" , async ( ) => {
8484 const expectedResponse = { vulnerabilities : [ "cve-data-1" , "cve-data-2" ] } ;
8585
8686 const paramsFirst = new URLSearchParams ( ) ;
@@ -96,14 +96,14 @@ describe("nvd", () => {
9696 path : `${ new URL ( nvd . ROOT_API ) . pathname } ?${ queryStringFirst } ` ,
9797 method : "GET"
9898 } )
99- . reply ( 200 , expectedResponse , kHttpClientHeaders ) ;
99+ . reply ( 200 , expectedResponse , HTTP_CLIENT_HEADERS ) ;
100100
101101 mockedHttpClient
102102 . intercept ( {
103103 path : `${ new URL ( nvd . ROOT_API ) . pathname } ?${ queryStringSecond } ` ,
104104 method : "GET"
105105 } )
106- . reply ( 200 , expectedResponse , kHttpClientHeaders ) ;
106+ . reply ( 200 , expectedResponse , HTTP_CLIENT_HEADERS ) ;
107107
108108 const result = await nvd . findMany (
109109 [ "foobar" , "yoobar" ]
@@ -115,7 +115,7 @@ describe("nvd", () => {
115115 } ) ;
116116 } ) ;
117117
118- test ( ` should handle empty response from NVD API` , async ( ) => {
118+ test ( " should handle empty response from NVD API" , async ( ) => {
119119 const emptyResponse = { } ;
120120
121121 const params = new URLSearchParams ( ) ;
@@ -127,7 +127,7 @@ describe("nvd", () => {
127127 path : `${ new URL ( nvd . ROOT_API ) . pathname } ?${ queryString } ` ,
128128 method : "GET"
129129 } )
130- . reply ( 200 , emptyResponse , kHttpClientHeaders ) ;
130+ . reply ( 200 , emptyResponse , HTTP_CLIENT_HEADERS ) ;
131131
132132 const vulns = await nvd . findOne ( {
133133 packageName : "nonexistent" ,
0 commit comments