Skip to content

Commit 009b9b7

Browse files
Update MockConfig to update request and response body
1 parent 3af9044 commit 009b9b7

8 files changed

Lines changed: 352 additions & 161 deletions

File tree

package-lock.json

Lines changed: 122 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"@types/chai": "^4.2.16",
3737
"@types/fs-extra": "^11.0.4",
3838
"@types/ip": "^1.1.3",
39+
"@types/jsonpath": "^0.2.4",
3940
"@types/lodash": "^4.14.170",
4041
"@types/mocha": "^8.2.2",
4142
"@types/node": "^15.6.1",
@@ -95,6 +96,7 @@
9596
"get-port": "^5.1.1",
9697
"http-mitm-proxy": "^1.1.0",
9798
"ip": "^1.1.8",
99+
"jsonpath": "^1.1.1",
98100
"lodash": "^4.17.21",
99101
"minimatch": "^9.0.3",
100102
"regex-parser": "^2.3.0",

src/mock.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { MockConfig } from './types';
2+
3+
export class Mock {
4+
private enabled = true;
5+
6+
constructor(private id: string, private config: MockConfig) {}
7+
8+
getId() {
9+
return this.id;
10+
}
11+
12+
getConfig() {
13+
return this.config;
14+
}
15+
16+
isEnabled() {
17+
return this.enabled;
18+
}
19+
20+
setEnableStatus(enbaleStatus: boolean) {
21+
this.enabled = enbaleStatus;
22+
}
23+
24+
updateConfig(config: MockConfig) {
25+
this.config = config;
26+
}
27+
}

src/proxy-middlewares/br.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)