Comparing version 1.3.1 to 1.3.2
@@ -1,2 +0,2 @@ | ||
import { lookup as nativeCallbackLookup } from './dns.js' // HACK WARNING | ||
import { lookup as nativeCallbackLookup } from 'dns' | ||
import { promisify } from 'util' | ||
@@ -3,0 +3,0 @@ import got from 'got' |
@@ -1,5 +0,12 @@ | ||
import { expect, describe, it } from '@jest/globals' | ||
import { expect, describe, it, jest } from '@jest/globals' | ||
import nock from 'nock' | ||
import { gotSsrf } from './index.js' | ||
// We can directly mock the "import { lookup } from 'dns'" call in index.js with jest. | ||
const mockDnsModule = await import('./__mocks__/dns.js') | ||
jest.unstable_mockModule('dns', () => mockDnsModule) | ||
// However, it does mean that we need to do a dynamic import to make sure we load the mocked import. | ||
// See: https://jestjs.io/docs/ecmascript-modules#module-mocking-in-esm | ||
const { gotSsrf } = await import('./index.js') | ||
nock.disableNetConnect() | ||
@@ -6,0 +13,0 @@ |
{ | ||
"name": "got-ssrf", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Protect Got requests from SSRF", | ||
@@ -26,8 +26,7 @@ "type": "module", | ||
"devDependencies": { | ||
"@janejeon/eslint-config": "^2.2.0", | ||
"@janejeon/eslint-config": "3.0.0-3", | ||
"@janejeon/prettier-config": "^1.1.0", | ||
"enhanced-resolve": "^5.8.3", | ||
"husky": "^8.0.1", | ||
"jest": "^27.2.1", | ||
"jest-junit": "^14.0.0", | ||
"jest": "^29.5.0", | ||
"jest-junit": "^16.0.0", | ||
"lint-staged": "13.0.3", | ||
@@ -34,0 +33,0 @@ "nock": "^13.1.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10
18864
8
145