@leyyo/http-mock 1.1.1 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -6
- package/dist/application/index.types.d.ts +58 -0
- package/dist/{request/index-types.js → application/index.types.js} +1 -1
- package/dist/application/index.types.js.map +1 -0
- package/dist/application/mock-application.d.ts +47 -56
- package/dist/application/mock-application.js +162 -87
- package/dist/application/mock-application.js.map +1 -1
- package/dist/http-mock.d.ts +2 -10
- package/dist/http-mock.js +19 -9
- package/dist/http-mock.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/index.types.d.ts +10 -0
- package/dist/index.types.js +3 -0
- package/dist/index.types.js.map +1 -0
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +6 -0
- package/dist/internal.js.map +1 -0
- package/dist/request/index.d.ts +2 -2
- package/dist/request/index.js +2 -2
- package/dist/request/index.types.d.ts +25 -0
- package/dist/request/index.types.js +3 -0
- package/dist/request/index.types.js.map +1 -0
- package/dist/request/mock.request.d.ts +123 -0
- package/dist/request/mock.request.js +261 -0
- package/dist/request/mock.request.js.map +1 -0
- package/dist/response/index-types.d.ts +19 -15
- package/dist/response/mock-response.d.ts +72 -78
- package/dist/response/mock-response.js +174 -154
- package/dist/response/mock-response.js.map +1 -1
- package/dist/shared/http-event.d.ts +36 -0
- package/dist/shared/http-event.js +94 -0
- package/dist/shared/http-event.js.map +1 -0
- package/dist/shared/http-method.d.ts +11 -0
- package/dist/shared/http-method.js +20 -0
- package/dist/shared/http-method.js.map +1 -0
- package/dist/shared/http-protocol.d.ts +10 -0
- package/dist/shared/http-protocol.js +12 -0
- package/dist/shared/http-protocol.js.map +1 -0
- package/dist/shared/index.d.ts +4 -0
- package/dist/shared/index.js +21 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/index.types.d.ts +27 -0
- package/dist/shared/index.types.js +3 -0
- package/dist/shared/index.types.js.map +1 -0
- package/package.json +29 -33
- package/dist/internal-component.d.ts +0 -3
- package/dist/internal-component.js +0 -8
- package/dist/internal-component.js.map +0 -1
- package/dist/request/index-types.d.ts +0 -20
- package/dist/request/index-types.js.map +0 -1
- package/dist/request/mock-request.d.ts +0 -121
- package/dist/request/mock-request.js +0 -229
- package/dist/request/mock-request.js.map +0 -1
- package/dist/server.d.ts +0 -0
- package/dist/server.js +0 -2
- package/dist/server.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Leyyo: Http Mock
|
|
2
|
+
Http Mock library for Leyyo framework
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
## Import
|
|
5
|
+
- `npm i @leyyo/http-mock`
|
|
4
6
|
|
|
5
|
-
##
|
|
6
|
-
- `
|
|
7
|
-
- `
|
|
8
|
-
- `
|
|
7
|
+
## Standards
|
|
8
|
+
- Language: `TS`
|
|
9
|
+
- Eslint: `Yes`
|
|
10
|
+
- Static Code Analysis: `Yes` *IntelliJ Code Inspections*
|
|
11
|
+
- DDD - Document Driven: `Yes`
|
|
12
|
+
- DDD - Domain Driven: `Yes`
|
|
13
|
+
- EDD - Exception Driven: `Yes`
|
|
14
|
+
- TDD - Test Driven: `Yes`
|
|
15
|
+
- LDD - Log Driven: `Yes`
|
|
16
|
+
- 12FA - 12 Factor-App: `50%` *Partially*
|
|
17
|
+
|
|
18
|
+
## Dependencies
|
|
19
|
+
### NO
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
### Prepared by
|
|
23
|
+
- Mustafa Yelmer
|
|
24
|
+
- mustafayelmer(at)gmail.com
|
|
25
|
+
- `2022-01-17`
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { EventEmitter } from "node:events";
|
|
2
|
+
import type { RequestParamHandler, Router } from "express";
|
|
3
|
+
import type http from "http";
|
|
4
|
+
export interface MockApplicationLike extends EventEmitter {
|
|
5
|
+
"m-search"(...a: Array<unknown>): this;
|
|
6
|
+
_router: any;
|
|
7
|
+
locals: Record<string, any>;
|
|
8
|
+
map: any;
|
|
9
|
+
mountpath: string | string[];
|
|
10
|
+
options(...a: Array<unknown>): this;
|
|
11
|
+
patch(...a: Array<unknown>): this;
|
|
12
|
+
post(...a: Array<unknown>): this;
|
|
13
|
+
propfind(...a: Array<unknown>): this;
|
|
14
|
+
proppatch(...a: Array<unknown>): this;
|
|
15
|
+
purge(...a: Array<unknown>): this;
|
|
16
|
+
put(...a: Array<unknown>): this;
|
|
17
|
+
report(...a: Array<unknown>): this;
|
|
18
|
+
link(...a: Array<unknown>): this;
|
|
19
|
+
unlink(...a: Array<unknown>): this;
|
|
20
|
+
all(...a: Array<unknown>): this;
|
|
21
|
+
checkout(...a: Array<unknown>): this;
|
|
22
|
+
connect(...a: Array<unknown>): this;
|
|
23
|
+
copy(...a: Array<unknown>): this;
|
|
24
|
+
delete(...a: Array<unknown>): this;
|
|
25
|
+
get(name: string): any;
|
|
26
|
+
get(...a: Array<unknown>): this;
|
|
27
|
+
head(...a: Array<unknown>): this;
|
|
28
|
+
lock(...a: Array<unknown>): this;
|
|
29
|
+
merge(...a: Array<unknown>): this;
|
|
30
|
+
mkactivity(...a: Array<unknown>): this;
|
|
31
|
+
mkcol(...a: Array<unknown>): this;
|
|
32
|
+
move(...a: Array<unknown>): this;
|
|
33
|
+
notify(...a: Array<unknown>): this;
|
|
34
|
+
search(...a: Array<unknown>): this;
|
|
35
|
+
subscribe(...a: Array<unknown>): this;
|
|
36
|
+
trace(...a: Array<unknown>): this;
|
|
37
|
+
unlock(...a: Array<unknown>): this;
|
|
38
|
+
unsubscribe(...a: Array<unknown>): this;
|
|
39
|
+
use(...a: Array<unknown>): this;
|
|
40
|
+
resource: any;
|
|
41
|
+
router: Router;
|
|
42
|
+
routes: any;
|
|
43
|
+
settings: any;
|
|
44
|
+
stack: any[];
|
|
45
|
+
defaultConfiguration(): void;
|
|
46
|
+
disable(_s: string): this;
|
|
47
|
+
disabled(_s: string): boolean;
|
|
48
|
+
enable(_s: string): this;
|
|
49
|
+
enabled(_s: string): boolean;
|
|
50
|
+
engine(_e: string, _f: (path: string, options: object, callback: (e: any, rendered?: string) => void) => void): this;
|
|
51
|
+
init(): void;
|
|
52
|
+
listen(_p?: any, _h?: string | (() => void), _b?: number | (() => void), _c?: () => void): http.Server;
|
|
53
|
+
param(name: string | string[] | ((name: string, matcher: RegExp) => RequestParamHandler), handler?: RequestParamHandler): this;
|
|
54
|
+
path(): string;
|
|
55
|
+
render(_n: string, _o?: object | ((err: Error, html: string) => void), _c?: (err: Error, html: string) => void): void;
|
|
56
|
+
route(_p: unknown): any;
|
|
57
|
+
set(_s: string, _v: any): this;
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.types.js","sourceRoot":"","sources":["../../src/application/index.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,70 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
import { Application, IRouterMatcher, RequestParamHandler } from "express";
|
|
1
|
+
import { Application, RequestParamHandler, Router } from "express";
|
|
3
2
|
import * as http from "http";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { MockApplicationLike } from "./index.types";
|
|
4
|
+
import { HttpEvent } from "../shared";
|
|
5
|
+
export declare class MockApplication extends HttpEvent<Application> implements MockApplicationLike {
|
|
6
6
|
_router: any;
|
|
7
|
-
all(...a: Array<unknown>): this;
|
|
8
|
-
checkout(...a: Array<unknown>): this;
|
|
9
|
-
connect(...a: Array<unknown>): this;
|
|
10
|
-
copy(...a: Array<unknown>): this;
|
|
11
|
-
delete(...a: Array<unknown>): this;
|
|
12
|
-
get: ((name: string) => any) & IRouterMatcher<this>;
|
|
13
|
-
head(...a: Array<unknown>): this;
|
|
14
7
|
locals: Record<string, any>;
|
|
15
|
-
lock(...a: Array<unknown>): this;
|
|
16
8
|
map: any;
|
|
17
|
-
merge(...a: Array<unknown>): this;
|
|
18
|
-
mkactivity(...a: Array<unknown>): this;
|
|
19
|
-
mkcol(...a: Array<unknown>): this;
|
|
20
9
|
mountpath: string | string[];
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
10
|
+
constructor(origin?: Application);
|
|
11
|
+
"m-search"(..._a: Array<unknown>): this;
|
|
12
|
+
options(..._a: Array<unknown>): this;
|
|
13
|
+
patch(..._a: Array<unknown>): this;
|
|
14
|
+
post(..._a: Array<unknown>): this;
|
|
15
|
+
propfind(..._a: Array<unknown>): this;
|
|
16
|
+
proppatch(..._a: Array<unknown>): this;
|
|
17
|
+
purge(..._a: Array<unknown>): this;
|
|
18
|
+
put(..._a: Array<unknown>): this;
|
|
19
|
+
report(..._a: Array<unknown>): this;
|
|
20
|
+
link(..._a: Array<unknown>): this;
|
|
21
|
+
unlink(..._a: Array<unknown>): this;
|
|
22
|
+
all(..._a: Array<unknown>): this;
|
|
23
|
+
checkout(..._a: Array<unknown>): this;
|
|
24
|
+
connect(..._a: Array<unknown>): this;
|
|
25
|
+
copy(..._a: Array<unknown>): this;
|
|
26
|
+
delete(..._a: Array<unknown>): this;
|
|
27
|
+
get(..._a: Array<unknown>): this;
|
|
28
|
+
head(..._a: Array<unknown>): this;
|
|
29
|
+
lock(..._a: Array<unknown>): this;
|
|
30
|
+
merge(..._a: Array<unknown>): this;
|
|
31
|
+
mkactivity(..._a: Array<unknown>): this;
|
|
32
|
+
mkcol(..._a: Array<unknown>): this;
|
|
33
|
+
move(..._a: Array<unknown>): this;
|
|
34
|
+
notify(..._a: Array<unknown>): this;
|
|
35
|
+
search(..._a: Array<unknown>): this;
|
|
36
|
+
subscribe(..._a: Array<unknown>): this;
|
|
37
|
+
trace(..._a: Array<unknown>): this;
|
|
38
|
+
unlock(..._a: Array<unknown>): this;
|
|
39
|
+
unsubscribe(..._a: Array<unknown>): this;
|
|
40
|
+
use(..._a: Array<unknown>): this;
|
|
32
41
|
resource: any;
|
|
33
|
-
router:
|
|
42
|
+
router: Router;
|
|
34
43
|
routes: any;
|
|
35
|
-
search(...a: Array<unknown>): this;
|
|
36
44
|
settings: any;
|
|
37
45
|
stack: any[];
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
unlock(...a: Array<unknown>): this;
|
|
41
|
-
unsubscribe(...a: Array<unknown>): this;
|
|
42
|
-
use(...a: Array<unknown>): this;
|
|
43
|
-
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
46
|
+
static setFirstOrigin(origin: Application): void;
|
|
47
|
+
static get firstOrigin(): Application;
|
|
44
48
|
defaultConfiguration(): void;
|
|
45
|
-
disable(
|
|
46
|
-
disabled(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
engine(ext: string, fn: (path: string, options: object, callback: (e: any, rendered?: string) => void) => void): this;
|
|
51
|
-
eventNames(): Array<string | symbol>;
|
|
52
|
-
getMaxListeners(): number;
|
|
49
|
+
disable(_s: string): this;
|
|
50
|
+
disabled(_s: string): boolean;
|
|
51
|
+
enable(_s: string): this;
|
|
52
|
+
enabled(_s: string): boolean;
|
|
53
|
+
engine(_e: string, _f: (path: string, options: object, callback: (e: any, rendered?: string) => void) => void): this;
|
|
53
54
|
init(): void;
|
|
54
|
-
listen(
|
|
55
|
-
listenerCount(eventName: string | symbol): number;
|
|
56
|
-
listeners(eventName: string | symbol): Function[];
|
|
57
|
-
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
58
|
-
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
55
|
+
listen(_p?: any, _h?: string | (() => void), _b?: number | (() => void), _c?: () => void): http.Server;
|
|
59
56
|
param(name: string | string[] | ((name: string, matcher: RegExp) => RequestParamHandler), handler?: RequestParamHandler): this;
|
|
60
57
|
path(): string;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
removeAllListeners(event?: string | symbol): this;
|
|
65
|
-
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
66
|
-
render(name: string, options?: object | ((err: Error, html: string) => void), callback?: (err: Error, html: string) => void): void;
|
|
67
|
-
route(prefix: any): any;
|
|
68
|
-
set(setting: string, val: any): this;
|
|
69
|
-
setMaxListeners(n: number): this;
|
|
58
|
+
render(_n: string, _o?: object | ((err: Error, html: string) => void), _c?: (err: Error, html: string) => void): void;
|
|
59
|
+
route(_p: unknown): any;
|
|
60
|
+
set(_s: string, _v: any): this;
|
|
70
61
|
}
|
|
@@ -1,120 +1,195 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MockApplication = void 0;
|
|
4
|
-
const
|
|
4
|
+
const shared_1 = require("../shared");
|
|
5
|
+
const common_1 = require("@leyyo/common");
|
|
6
|
+
let _firstOrigin;
|
|
5
7
|
// noinspection JSUnusedGlobalSymbols
|
|
6
|
-
class MockApplication {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
lock(...a) { return this; }
|
|
15
|
-
merge(...a) { return this; }
|
|
16
|
-
mkactivity(...a) { return this; }
|
|
17
|
-
mkcol(...a) { return this; }
|
|
18
|
-
move(...a) { return this; }
|
|
19
|
-
notify(...a) { return this; }
|
|
20
|
-
on(event, callback) {
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
options(...a) { return this; }
|
|
24
|
-
patch(...a) { return this; }
|
|
25
|
-
post(...a) { return this; }
|
|
26
|
-
propfind(...a) { return this; }
|
|
27
|
-
proppatch(...a) { return this; }
|
|
28
|
-
purge(...a) { return this; }
|
|
29
|
-
put(...a) { return this; }
|
|
30
|
-
report(...a) { return this; }
|
|
31
|
-
search(...a) { return this; }
|
|
32
|
-
subscribe(...a) { return this; }
|
|
33
|
-
trace(...a) { return this; }
|
|
34
|
-
unlock(...a) { return this; }
|
|
35
|
-
unsubscribe(...a) { return this; }
|
|
36
|
-
use(...a) { return this; }
|
|
37
|
-
addListener(eventName, listener) {
|
|
38
|
-
return undefined;
|
|
39
|
-
}
|
|
40
|
-
defaultConfiguration() {
|
|
41
|
-
(0, core_1.emptyFn)();
|
|
42
|
-
}
|
|
43
|
-
disable(setting) {
|
|
44
|
-
return undefined;
|
|
8
|
+
class MockApplication extends shared_1.HttpEvent {
|
|
9
|
+
constructor(origin) {
|
|
10
|
+
super(origin);
|
|
11
|
+
}
|
|
12
|
+
// region methods
|
|
13
|
+
"m-search"(..._a) {
|
|
14
|
+
logger.warn('Should not be called', { fn: 'm-search' });
|
|
15
|
+
return this;
|
|
45
16
|
}
|
|
46
|
-
|
|
47
|
-
|
|
17
|
+
options(..._a) {
|
|
18
|
+
logger.warn('Should not be called', { fn: 'options' });
|
|
19
|
+
return this;
|
|
48
20
|
}
|
|
49
|
-
|
|
50
|
-
|
|
21
|
+
patch(..._a) {
|
|
22
|
+
logger.warn('Should not be called', { fn: 'patch' });
|
|
23
|
+
return this;
|
|
51
24
|
}
|
|
52
|
-
|
|
53
|
-
|
|
25
|
+
post(..._a) {
|
|
26
|
+
logger.warn('Should not be called', { fn: 'post' });
|
|
27
|
+
return this;
|
|
54
28
|
}
|
|
55
|
-
|
|
56
|
-
|
|
29
|
+
propfind(..._a) {
|
|
30
|
+
logger.warn('Should not be called', { fn: 'propfind' });
|
|
31
|
+
return this;
|
|
57
32
|
}
|
|
58
|
-
|
|
59
|
-
|
|
33
|
+
proppatch(..._a) {
|
|
34
|
+
logger.warn('Should not be called', { fn: 'proppatch' });
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
purge(..._a) {
|
|
38
|
+
logger.warn('Should not be called', { fn: 'purge' });
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
put(..._a) {
|
|
42
|
+
logger.warn('Should not be called', { fn: 'put' });
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
report(..._a) {
|
|
46
|
+
logger.warn('Should not be called', { fn: 'report' });
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
link(..._a) {
|
|
50
|
+
logger.warn('Should not be called', { fn: 'link' });
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
unlink(..._a) {
|
|
54
|
+
logger.warn('Should not be called', { fn: 'unlink' });
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
all(..._a) {
|
|
58
|
+
logger.warn('Should not be called', { fn: 'all' });
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
checkout(..._a) {
|
|
62
|
+
logger.warn('Should not be called', { fn: 'checkout' });
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
connect(..._a) {
|
|
66
|
+
logger.warn('Should not be called', { fn: 'connect' });
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
copy(..._a) {
|
|
70
|
+
logger.warn('Should not be called', { fn: 'copy' });
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
delete(..._a) {
|
|
74
|
+
logger.warn('Should not be called', { fn: 'delete' });
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
get(..._a) {
|
|
78
|
+
logger.warn('Should not be called', { fn: 'get' });
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
head(..._a) {
|
|
82
|
+
logger.warn('Should not be called', { fn: 'head' });
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
lock(..._a) {
|
|
86
|
+
logger.warn('Should not be called', { fn: 'lock' });
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
89
|
+
merge(..._a) {
|
|
90
|
+
logger.warn('Should not be called', { fn: 'merge' });
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
mkactivity(..._a) {
|
|
94
|
+
logger.warn('Should not be called', { fn: 'mkactivity' });
|
|
95
|
+
return this;
|
|
96
|
+
}
|
|
97
|
+
mkcol(..._a) {
|
|
98
|
+
logger.warn('Should not be called', { fn: 'mkcol' });
|
|
99
|
+
return this;
|
|
100
|
+
}
|
|
101
|
+
move(..._a) {
|
|
102
|
+
logger.warn('Should not be called', { fn: 'move' });
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
notify(..._a) {
|
|
106
|
+
logger.warn('Should not be called', { fn: 'notify' });
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
109
|
+
search(..._a) {
|
|
110
|
+
logger.warn('Should not be called', { fn: 'search' });
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
subscribe(..._a) {
|
|
114
|
+
logger.warn('Should not be called', { fn: 'subscribe' });
|
|
115
|
+
return this;
|
|
60
116
|
}
|
|
61
|
-
|
|
62
|
-
|
|
117
|
+
trace(..._a) {
|
|
118
|
+
logger.warn('Should not be called', { fn: 'trace' });
|
|
119
|
+
return this;
|
|
63
120
|
}
|
|
64
|
-
|
|
65
|
-
|
|
121
|
+
unlock(..._a) {
|
|
122
|
+
logger.warn('Should not be called', { fn: 'unlock' });
|
|
123
|
+
return this;
|
|
66
124
|
}
|
|
67
|
-
|
|
68
|
-
(
|
|
125
|
+
unsubscribe(..._a) {
|
|
126
|
+
logger.warn('Should not be called', { fn: 'unsubscribe' });
|
|
127
|
+
return this;
|
|
69
128
|
}
|
|
70
|
-
|
|
71
|
-
|
|
129
|
+
use(..._a) {
|
|
130
|
+
logger.warn('Should not be called', { fn: 'use' });
|
|
131
|
+
return this;
|
|
72
132
|
}
|
|
73
|
-
|
|
74
|
-
|
|
133
|
+
// region static
|
|
134
|
+
// noinspection JSUnusedGlobalSymbols
|
|
135
|
+
static setFirstOrigin(origin) {
|
|
136
|
+
if (!_firstOrigin && origin) {
|
|
137
|
+
_firstOrigin = origin;
|
|
138
|
+
}
|
|
75
139
|
}
|
|
76
|
-
|
|
77
|
-
return
|
|
140
|
+
static get firstOrigin() {
|
|
141
|
+
return _firstOrigin;
|
|
78
142
|
}
|
|
79
|
-
|
|
80
|
-
|
|
143
|
+
// endregion static
|
|
144
|
+
defaultConfiguration() {
|
|
145
|
+
logger.warn('Should not be called', { fn: 'defaultConfiguration' });
|
|
81
146
|
}
|
|
82
|
-
|
|
83
|
-
|
|
147
|
+
disable(_s) {
|
|
148
|
+
logger.warn('Should not be called', { fn: 'disable' });
|
|
149
|
+
return this;
|
|
84
150
|
}
|
|
85
|
-
|
|
86
|
-
|
|
151
|
+
disabled(_s) {
|
|
152
|
+
logger.warn('Should not be called', { fn: 'disabled' });
|
|
153
|
+
return false;
|
|
87
154
|
}
|
|
88
|
-
|
|
89
|
-
|
|
155
|
+
enable(_s) {
|
|
156
|
+
logger.warn('Should not be called', { fn: 'enable' });
|
|
157
|
+
return this;
|
|
90
158
|
}
|
|
91
|
-
|
|
92
|
-
|
|
159
|
+
enabled(_s) {
|
|
160
|
+
logger.warn('Should not be called', { fn: 'enabled' });
|
|
161
|
+
return false;
|
|
93
162
|
}
|
|
94
|
-
|
|
95
|
-
|
|
163
|
+
engine(_e, _f) {
|
|
164
|
+
logger.warn('Should not be called', { fn: 'engine' });
|
|
165
|
+
return this;
|
|
96
166
|
}
|
|
97
|
-
|
|
98
|
-
|
|
167
|
+
init() {
|
|
168
|
+
logger.warn('Should not be called', { fn: 'init' });
|
|
99
169
|
}
|
|
100
|
-
|
|
170
|
+
listen(_p, _h, _b, _c) {
|
|
171
|
+
logger.warn('Should not be called', { fn: 'listen' });
|
|
101
172
|
return undefined;
|
|
102
173
|
}
|
|
103
|
-
|
|
104
|
-
|
|
174
|
+
param(name, handler) {
|
|
175
|
+
var _d;
|
|
176
|
+
return (_d = this._origin) === null || _d === void 0 ? void 0 : _d.param(name, handler);
|
|
105
177
|
}
|
|
106
|
-
|
|
107
|
-
|
|
178
|
+
path() {
|
|
179
|
+
var _d;
|
|
180
|
+
return (_d = this._origin) === null || _d === void 0 ? void 0 : _d.path();
|
|
108
181
|
}
|
|
109
|
-
|
|
110
|
-
(
|
|
182
|
+
render(_n, _o, _c) {
|
|
183
|
+
logger.warn('Should not be called', { fn: 'render' });
|
|
111
184
|
}
|
|
112
|
-
|
|
113
|
-
|
|
185
|
+
route(_p) {
|
|
186
|
+
logger.warn('Should not be called', { fn: 'route' });
|
|
114
187
|
}
|
|
115
|
-
|
|
116
|
-
|
|
188
|
+
set(_s, _v) {
|
|
189
|
+
logger.warn('Should not be called', { fn: 'set' });
|
|
190
|
+
return this;
|
|
117
191
|
}
|
|
118
192
|
}
|
|
119
193
|
exports.MockApplication = MockApplication;
|
|
194
|
+
const logger = common_1.$log.create(MockApplication);
|
|
120
195
|
//# sourceMappingURL=mock-application.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-application.js","sourceRoot":"","sources":["../../src/application/mock-application.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"mock-application.js","sourceRoot":"","sources":["../../src/application/mock-application.ts"],"names":[],"mappings":";;;AAGA,sCAAoC;AACpC,0CAA2C;AAE3C,IAAI,YAAyB,CAAC;AAE9B,qCAAqC;AACrC,MAAa,eAAgB,SAAQ,kBAAsB;IAMvD,YAAY,MAAoB;QAC5B,KAAK,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IACD,iBAAiB;IACjB,UAAU,CAAC,GAAG,EAAkB;QAC5B,MAAM,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAC,EAAE,EAAE,UAAU,EAAC,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CAAC,GAAG,EAAkB;QACzB,MAAM,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAC,EAAE,EAAE,SAAS,EAAC,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,GAAG,EAAkB;QACvB,MAAM,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAC,EAAE,EAAE,OAAO,EAAC,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,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AI,CAAC;IAChB,CAAC;CACJ;AA/OD,0CA+OC;AAED,MAAM,MAAM,GAAW,aAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC"}
|
package/dist/http-mock.d.ts
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { MockRequestLike, MockServiceRequest, RequestBody } from "./request";
|
|
4
|
-
import { Request, Response } from "express";
|
|
5
|
-
declare class HttpMock {
|
|
6
|
-
request<T = RequestBody, L extends RecLike = RecLike>(service?: MockServiceRequest, origin?: Request, custom?: RecLike): MockRequestLike<T, L>;
|
|
7
|
-
response<D = ResponseData, L extends RecLike = RecLike>(resolver?: MockResponseResolve, origin?: Response): MockResponseLike<D, L>;
|
|
8
|
-
}
|
|
9
|
-
export declare const httpMock: HttpMock;
|
|
10
|
-
export {};
|
|
1
|
+
import type { HttpMockLike } from "./index.types";
|
|
2
|
+
export declare const httpMock: HttpMockLike;
|
package/dist/http-mock.js
CHANGED
|
@@ -2,19 +2,29 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.httpMock = void 0;
|
|
4
4
|
const response_1 = require("./response");
|
|
5
|
-
const core_1 = require("@leyyo/core");
|
|
6
5
|
const request_1 = require("./request");
|
|
7
|
-
const
|
|
6
|
+
const application_1 = require("./application");
|
|
8
7
|
class HttpMock {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
init(req) {
|
|
9
|
+
if (this._initialized) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
this._initialized = true;
|
|
13
|
+
request_1.MockRequest.setFirstOrigin(req);
|
|
14
|
+
response_1.MockResponse.setFirstOrigin(req.res);
|
|
15
|
+
application_1.MockApplication.setFirstOrigin(req.app);
|
|
11
16
|
}
|
|
12
|
-
|
|
13
|
-
return
|
|
17
|
+
fork() {
|
|
18
|
+
return [request_1.MockRequest.firstOrigin, response_1.MockResponse.firstOrigin, application_1.MockApplication.firstOrigin];
|
|
19
|
+
}
|
|
20
|
+
forBulk(req, service, resolver, custom) {
|
|
21
|
+
var _a;
|
|
22
|
+
const newReq = new request_1.MockRequest(service, req, custom);
|
|
23
|
+
const newRes = new response_1.MockResponse(resolver, req.res);
|
|
24
|
+
const newApp = (_a = application_1.MockApplication.firstOrigin) !== null && _a !== void 0 ? _a : new application_1.MockApplication(req.app);
|
|
25
|
+
return [newReq, newRes, newApp];
|
|
14
26
|
}
|
|
15
27
|
}
|
|
16
|
-
|
|
17
|
-
core_1.leyyo.component.add(internal_component_1.COMPONENT_NAME);
|
|
18
|
-
})();
|
|
28
|
+
// noinspection JSUnusedGlobalSymbols
|
|
19
29
|
exports.httpMock = new HttpMock();
|
|
20
30
|
//# sourceMappingURL=http-mock.js.map
|
package/dist/http-mock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-mock.js","sourceRoot":"","sources":["../src/http-mock.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"http-mock.js","sourceRoot":"","sources":["../src/http-mock.ts"],"names":[],"mappings":";;;AAAA,yCAAqF;AACrF,uCAA+D;AAE/D,+CAA8C;AAI9C,MAAM,QAAQ;IAEV,IAAI,CAAC,GAAY;QACb,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACpB,OAAO;QACX,CAAC;QACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,qBAAW,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QAChC,uBAAY,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrC,6BAAe,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;IACD,IAAI;QACA,OAAO,CAAC,qBAAW,CAAC,WAAW,EAAE,uBAAY,CAAC,WAAW,EAAE,6BAAe,CAAC,WAAW,CAAC,CAAC;IAC5F,CAAC;IAED,OAAO,CAAmB,GAAY,EAAE,OAA8B,EAAE,QAAgC,EAAE,MAAa;;QACnH,MAAM,MAAM,GAAG,IAAI,qBAAW,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACrD,MAAM,MAAM,GAAG,IAAI,uBAAY,CAAC,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,MAAA,6BAAe,CAAC,WAAW,mCAAK,IAAI,6BAAe,CAAC,GAAG,CAAC,GAAG,CAA4B,CAAC;QACvG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC;CACJ;AACD,qCAAqC;AACxB,QAAA,QAAQ,GAAiB,IAAI,QAAQ,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,5 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./shared"), exports);
|
|
18
|
+
__exportStar(require("./application"), exports);
|
|
19
|
+
__exportStar(require("./request"), exports);
|
|
20
|
+
__exportStar(require("./response"), exports);
|
|
17
21
|
__exportStar(require("./http-mock"), exports);
|
|
22
|
+
__exportStar(require("./index.types"), exports);
|
|
18
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,gDAA8B;AAC9B,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,gDAA8B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Application, Request, Response } from "express";
|
|
2
|
+
import type { MockResponseResolve, ResponseData } from "./response";
|
|
3
|
+
import type { MockServiceRequest } from "./request";
|
|
4
|
+
import type { Dict } from "@leyyo/common";
|
|
5
|
+
export type HttpMockTuple = [Request, Response, Application];
|
|
6
|
+
export interface HttpMockLike {
|
|
7
|
+
init(req: Request): void;
|
|
8
|
+
fork(): HttpMockTuple;
|
|
9
|
+
forBulk<R = ResponseData>(req: Request, service: MockServiceRequest<R>, resolver: MockResponseResolve<R>, custom?: Dict): HttpMockTuple;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.types.js","sourceRoot":"","sources":["../src/index.types.ts"],"names":[],"mappings":""}
|