weifuwu 0.22.1 → 0.22.2
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/dist/index.js +21 -15
- package/dist/test-utils.d.ts +10 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1703,6 +1703,12 @@ var TestResponseImpl = class {
|
|
|
1703
1703
|
async text() {
|
|
1704
1704
|
return this.response.text();
|
|
1705
1705
|
}
|
|
1706
|
+
async bytes() {
|
|
1707
|
+
return this.response.bytes();
|
|
1708
|
+
}
|
|
1709
|
+
async arrayBuffer() {
|
|
1710
|
+
return this.response.arrayBuffer();
|
|
1711
|
+
}
|
|
1706
1712
|
};
|
|
1707
1713
|
var TestRequest = class {
|
|
1708
1714
|
headers = {};
|
|
@@ -1783,29 +1789,29 @@ var TestApp = class {
|
|
|
1783
1789
|
this.router.use(mw);
|
|
1784
1790
|
return this;
|
|
1785
1791
|
}
|
|
1786
|
-
/** Register a GET route */
|
|
1787
|
-
get(path2,
|
|
1788
|
-
this.router.get(path2,
|
|
1792
|
+
/** Register a GET route — supports route-level middleware via spread args. */
|
|
1793
|
+
get(path2, ...args) {
|
|
1794
|
+
this.router.get(path2, ...args);
|
|
1789
1795
|
return this;
|
|
1790
1796
|
}
|
|
1791
|
-
/** Register a POST route */
|
|
1792
|
-
post(path2,
|
|
1793
|
-
this.router.post(path2,
|
|
1797
|
+
/** Register a POST route. */
|
|
1798
|
+
post(path2, ...args) {
|
|
1799
|
+
this.router.post(path2, ...args);
|
|
1794
1800
|
return this;
|
|
1795
1801
|
}
|
|
1796
|
-
/** Register a PUT route */
|
|
1797
|
-
put(path2,
|
|
1798
|
-
this.router.put(path2,
|
|
1802
|
+
/** Register a PUT route. */
|
|
1803
|
+
put(path2, ...args) {
|
|
1804
|
+
this.router.put(path2, ...args);
|
|
1799
1805
|
return this;
|
|
1800
1806
|
}
|
|
1801
|
-
/** Register a PATCH route */
|
|
1802
|
-
patch(path2,
|
|
1803
|
-
this.router.patch(path2,
|
|
1807
|
+
/** Register a PATCH route. */
|
|
1808
|
+
patch(path2, ...args) {
|
|
1809
|
+
this.router.patch(path2, ...args);
|
|
1804
1810
|
return this;
|
|
1805
1811
|
}
|
|
1806
|
-
/** Register a DELETE route */
|
|
1807
|
-
delete(path2,
|
|
1808
|
-
this.router.delete(path2,
|
|
1812
|
+
/** Register a DELETE route. */
|
|
1813
|
+
delete(path2, ...args) {
|
|
1814
|
+
this.router.delete(path2, ...args);
|
|
1809
1815
|
return this;
|
|
1810
1816
|
}
|
|
1811
1817
|
/** Start building a GET request */
|
package/dist/test-utils.d.ts
CHANGED
|
@@ -38,16 +38,16 @@ export declare class TestApp {
|
|
|
38
38
|
constructor();
|
|
39
39
|
/** Add global middleware */
|
|
40
40
|
use(mw: any): this;
|
|
41
|
-
/** Register a GET route */
|
|
42
|
-
get(path: string,
|
|
43
|
-
/** Register a POST route */
|
|
44
|
-
post(path: string,
|
|
45
|
-
/** Register a PUT route */
|
|
46
|
-
put(path: string,
|
|
47
|
-
/** Register a PATCH route */
|
|
48
|
-
patch(path: string,
|
|
49
|
-
/** Register a DELETE route */
|
|
50
|
-
delete(path: string,
|
|
41
|
+
/** Register a GET route — supports route-level middleware via spread args. */
|
|
42
|
+
get(path: string, ...args: any[]): this;
|
|
43
|
+
/** Register a POST route. */
|
|
44
|
+
post(path: string, ...args: any[]): this;
|
|
45
|
+
/** Register a PUT route. */
|
|
46
|
+
put(path: string, ...args: any[]): this;
|
|
47
|
+
/** Register a PATCH route. */
|
|
48
|
+
patch(path: string, ...args: any[]): this;
|
|
49
|
+
/** Register a DELETE route. */
|
|
50
|
+
delete(path: string, ...args: any[]): this;
|
|
51
51
|
/** Start building a GET request */
|
|
52
52
|
getReq(path: string): TestRequest;
|
|
53
53
|
/** Start building a POST request */
|