This commit is contained in:
Nicolas 2024-07-29 18:37:09 -04:00
parent 04942bb9de
commit 968a2dc753
3 changed files with 19 additions and 0 deletions

View File

@ -26,6 +26,7 @@
"license": "ISC",
"devDependencies": {
"@flydotio/dockerfile": "^0.4.10",
"@jest/globals": "^29.7.0",
"@tsconfig/recommended": "^1.0.3",
"@types/body-parser": "^1.19.2",
"@types/bull": "^4.10.0",

View File

@ -192,6 +192,9 @@ importers:
'@flydotio/dockerfile':
specifier: ^0.4.10
version: 0.4.11
'@jest/globals':
specifier: ^29.7.0
version: 29.7.0
'@tsconfig/recommended':
specifier: ^1.0.3
version: 1.0.6

View File

@ -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();
});
});