@jest-mock/express
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -7,3 +7,3 @@ /// <reference types="jest" /> | ||
import type { Request } from 'express-serve-static-core'; | ||
import type { EventEventEmitter } from 'src'; | ||
import type { EventEventEmitter } from '../index'; | ||
interface StreamReadable extends EventEventEmitter { | ||
@@ -10,0 +10,0 @@ readable?: Readable['readable']; |
@@ -1,2 +0,3 @@ | ||
import { Request } from 'express'; | ||
/// <reference types="qs" /> | ||
import type { Request } from 'express'; | ||
import type { MockRequest } from './index'; | ||
@@ -6,3 +7,3 @@ /** | ||
*/ | ||
export declare const getMockReq: <T extends Request<import("express-serve-static-core").ParamsDictionary, any, any, ParsedQs, Record<string, any>>>(values?: MockRequest) => T; | ||
export declare const getMockReq: <T extends Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>>(values?: MockRequest) => T; | ||
export default getMockReq; |
@@ -7,3 +7,3 @@ /// <reference types="jest" /> | ||
import type { Response } from 'express'; | ||
import type { EventEventEmitter } from 'src'; | ||
import type { EventEventEmitter } from '../index'; | ||
interface StreamWritable extends EventEventEmitter { | ||
@@ -10,0 +10,0 @@ writable?: Writable['writable']; |
@@ -1,2 +0,2 @@ | ||
import { Response, NextFunction } from 'express'; | ||
import type { Response, NextFunction } from 'express'; | ||
import type { MockResponse } from './index'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -12,3 +12,3 @@ "use strict"; | ||
(function (AppOS) { | ||
AppOS[AppOS["Android"] = 1] = "Android"; | ||
AppOS["Android"] = "1"; | ||
})(AppOS || (AppOS = {})); | ||
@@ -15,0 +15,0 @@ const req = (0, request_1.default)({ |
@@ -18,4 +18,4 @@ "use strict"; | ||
id: '123', | ||
limit: 10, | ||
page: 2, | ||
limit: '10', | ||
page: '2', | ||
}, | ||
@@ -31,6 +31,6 @@ }); | ||
expect(req.query['id']).toBe('123'); | ||
expect(req.query['limit']).toBe(10); | ||
expect(req.query['page']).toBe(2); | ||
expect(req.query['limit']).toBe('10'); | ||
expect(req.query['page']).toBe('2'); | ||
}); | ||
}); | ||
//# sourceMappingURL=provided.test.js.map |
{ | ||
"name": "@jest-mock/express", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "A lightweight Jest mock for unit testing Express", | ||
@@ -45,3 +45,2 @@ "main": "dist/index.js", | ||
"@snyk/protect": "^1.947.0", | ||
"@types/express": "^4.17.13", | ||
"@types/jest": "^27.5.1", | ||
@@ -58,4 +57,6 @@ "@typescript-eslint/eslint-plugin": "^5.27.1", | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"@types/express": "^4.17.13" | ||
}, | ||
"snyk": true | ||
} |
@@ -5,4 +5,6 @@ // Types | ||
import type { Request } from 'express-serve-static-core' | ||
import type { EventEventEmitter } from 'src' | ||
// Local Types | ||
import type { EventEventEmitter } from '../index' | ||
interface StreamReadable extends EventEventEmitter { | ||
@@ -9,0 +11,0 @@ readable?: Readable['readable'] |
@@ -1,5 +0,5 @@ | ||
// Libraries | ||
import { Request } from 'express' | ||
// Types | ||
import type { Request } from 'express' | ||
// Types | ||
// Local Types | ||
import type { MockRequest } from './index' | ||
@@ -6,0 +6,0 @@ |
@@ -5,4 +5,6 @@ // Types | ||
import type { Response } from 'express' | ||
import type { EventEventEmitter } from 'src' | ||
// Local Types | ||
import type { EventEventEmitter } from '../index' | ||
interface StreamWritable extends EventEventEmitter { | ||
@@ -9,0 +11,0 @@ writable?: Writable['writable'] |
@@ -1,5 +0,5 @@ | ||
// Libraries | ||
import { Response, NextFunction } from 'express' | ||
// Types | ||
import type { Response, NextFunction } from 'express' | ||
// Types | ||
// Local Types | ||
import type { MockResponse } from './index' | ||
@@ -6,0 +6,0 @@ |
@@ -10,3 +10,3 @@ // Types | ||
enum AppOS { | ||
Android = 1, | ||
Android = '1', | ||
} | ||
@@ -13,0 +13,0 @@ |
@@ -27,4 +27,4 @@ // Types | ||
id: '123', | ||
limit: 10, | ||
page: 2, | ||
limit: '10', | ||
page: '2', | ||
}, | ||
@@ -42,5 +42,5 @@ }) | ||
expect(req.query['id']).toBe('123') | ||
expect(req.query['limit']).toBe(10) | ||
expect(req.query['page']).toBe(2) | ||
expect(req.query['limit']).toBe('10') | ||
expect(req.query['page']).toBe('2') | ||
}) | ||
}) |
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
704350
11
7759
1
+ Added@types/express@^4.17.13
+ Added@types/body-parser@1.19.5(transitive)
+ Added@types/connect@3.4.38(transitive)
+ Added@types/express@4.17.21(transitive)
+ Added@types/express-serve-static-core@4.19.6(transitive)
+ Added@types/http-errors@2.0.4(transitive)
+ Added@types/mime@1.3.5(transitive)
+ Added@types/node@22.10.1(transitive)
+ Added@types/qs@6.9.17(transitive)
+ Added@types/range-parser@1.2.7(transitive)
+ Added@types/send@0.17.4(transitive)
+ Added@types/serve-static@1.15.7(transitive)
+ Addedundici-types@6.20.0(transitive)