Nick:
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@flydotio/dockerfile": "^0.4.10",
|
"@flydotio/dockerfile": "^0.4.10",
|
||||||
|
"@jest/globals": "^29.7.0",
|
||||||
"@tsconfig/recommended": "^1.0.3",
|
"@tsconfig/recommended": "^1.0.3",
|
||||||
"@types/body-parser": "^1.19.2",
|
"@types/body-parser": "^1.19.2",
|
||||||
"@types/bull": "^4.10.0",
|
"@types/bull": "^4.10.0",
|
||||||
|
|||||||
Generated
+3
@@ -192,6 +192,9 @@ importers:
|
|||||||
'@flydotio/dockerfile':
|
'@flydotio/dockerfile':
|
||||||
specifier: ^0.4.10
|
specifier: ^0.4.10
|
||||||
version: 0.4.11
|
version: 0.4.11
|
||||||
|
'@jest/globals':
|
||||||
|
specifier: ^29.7.0
|
||||||
|
version: 29.7.0
|
||||||
'@tsconfig/recommended':
|
'@tsconfig/recommended':
|
||||||
specifier: ^1.0.3
|
specifier: ^1.0.3
|
||||||
version: 1.0.6
|
version: 1.0.6
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import CacheableLookup from 'cacheable-lookup';
|
||||||
|
import https from 'node:https';
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
describe("DNS", () => {
|
||||||
|
it("cached dns", async () => {
|
||||||
|
const cachedDns = new CacheableLookup();
|
||||||
|
cachedDns.install(https.globalAgent);
|
||||||
|
jest.spyOn(cachedDns, "lookupAsync");
|
||||||
|
|
||||||
|
const res = await axios.get("https://example.com");
|
||||||
|
expect(res.status).toBe(200);
|
||||||
|
expect(cachedDns.lookupAsync).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user