@loopback/testlab 5.0.5 → 5.0.7
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/client.d.ts +1 -1
- package/dist/http-error-logger.d.ts +1 -1
- package/dist/shot.d.ts +3 -3
- package/dist/sinon.d.ts +1 -1
- package/dist/skip.d.ts +1 -1
- package/dist/test-sandbox.js +6 -6
- package/dist/test-sandbox.js.map +1 -1
- package/package.json +9 -9
package/dist/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import http from 'http';
|
|
3
3
|
import supertest from 'supertest';
|
|
4
4
|
export { supertest };
|
|
5
|
-
export
|
|
5
|
+
export type Client = supertest.SuperTest<supertest.Test>;
|
|
6
6
|
/**
|
|
7
7
|
* Create a SuperTest client connected to an HTTP server listening
|
|
8
8
|
* on an ephemeral port and calling `handler` to handle incoming requests.
|
|
@@ -5,5 +5,5 @@ import { Request } from 'express';
|
|
|
5
5
|
* @param expectedStatusCode - HTTP status code that is expected
|
|
6
6
|
*/
|
|
7
7
|
export declare function createUnexpectedHttpErrorLogger(expectedStatusCode?: number): LogError;
|
|
8
|
-
|
|
8
|
+
type LogError = (err: Error, statusCode: number, request: Request) => void;
|
|
9
9
|
export {};
|
package/dist/shot.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ import { Listener as ShotListener, RequestOptions as ShotRequestOptions, Respons
|
|
|
5
5
|
declare const inject: (dispatchFunc: ShotListener, options: ShotRequestOptions) => Promise<ResponseObject>;
|
|
6
6
|
export { inject, ShotRequestOptions };
|
|
7
7
|
export declare function stubServerRequest(options: ShotRequestOptions): IncomingMessage;
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type ShotCallback = (response: ResponseObject) => void;
|
|
9
|
+
export type ShotResponseCtor = new (request: IncomingMessage, onEnd: ShotCallback) => ServerResponse;
|
|
10
10
|
export declare function stubServerResponse(request: IncomingMessage, onEnd: ShotCallback): ServerResponse;
|
|
11
|
-
export
|
|
11
|
+
export type ObservedResponse = ResponseObject;
|
|
12
12
|
export interface HandlerContextStub {
|
|
13
13
|
request: IncomingMessage;
|
|
14
14
|
response: ServerResponse;
|
package/dist/sinon.d.ts
CHANGED
package/dist/skip.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A function defining a new test case or a test suite, e.g. `it` or `describe`.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type TestDefinition<ARGS extends unknown[], RETVAL> = (name: string, ...args: ARGS) => RETVAL;
|
|
5
5
|
/**
|
|
6
6
|
* Helper function for skipping tests when a certain condition is met.
|
|
7
7
|
*
|
package/dist/test-sandbox.js
CHANGED
|
@@ -12,6 +12,12 @@ const path_1 = require("path");
|
|
|
12
12
|
* sandbox folder in which you can perform operations for testing purposes.
|
|
13
13
|
*/
|
|
14
14
|
class TestSandbox {
|
|
15
|
+
get path() {
|
|
16
|
+
if (!this._path) {
|
|
17
|
+
throw new Error(`TestSandbox instance was deleted. Create a new instance.`);
|
|
18
|
+
}
|
|
19
|
+
return this._path;
|
|
20
|
+
}
|
|
15
21
|
/**
|
|
16
22
|
* Will create a directory if it doesn't already exist. If it exists, you
|
|
17
23
|
* still get an instance of the TestSandbox.
|
|
@@ -51,12 +57,6 @@ class TestSandbox {
|
|
|
51
57
|
this._path = (0, fs_extra_1.mkdtempSync)((0, path_1.join)(rootPath, `/${process.pid}`));
|
|
52
58
|
}
|
|
53
59
|
}
|
|
54
|
-
get path() {
|
|
55
|
-
if (!this._path) {
|
|
56
|
-
throw new Error(`TestSandbox instance was deleted. Create a new instance.`);
|
|
57
|
-
}
|
|
58
|
-
return this._path;
|
|
59
|
-
}
|
|
60
60
|
/**
|
|
61
61
|
* Resets the TestSandbox. (Remove all files in it).
|
|
62
62
|
*/
|
package/dist/test-sandbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-sandbox.js","sourceRoot":"","sources":["../src/test-sandbox.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,iCAAiC;AACjC,+CAA+C;AAC/C,gEAAgE;;;AAEhE,uCAYkB;AAClB,+BAA0C;AAkB1C;;;GAGG;AACH,MAAa,WAAW;
|
|
1
|
+
{"version":3,"file":"test-sandbox.js","sourceRoot":"","sources":["../src/test-sandbox.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,iCAAiC;AACjC,+CAA+C;AAC/C,gEAAgE;;;AAEhE,uCAYkB;AAClB,+BAA0C;AAkB1C;;;GAGG;AACH,MAAa,WAAW;IAItB,IAAW,IAAI;QACb,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;SACH;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,YAAY,QAAgB,EAAE,OAA4B;QACxD,QAAQ,GAAG,IAAA,cAAO,EAAC,QAAQ,CAAC,CAAC;QAC7B,IAAA,wBAAa,EAAC,QAAQ,CAAC,CAAC;QACxB,OAAO,GAAG,EAAC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,EAAC,CAAC;QACrC,MAAM,MAAM,GAAG,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;QACzE,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI,EAAE;YAC3B,IAAI,CAAC,KAAK,GAAG,IAAA,cAAO,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;SACxC;aAAM;YACL,0DAA0D;YAC1D,sEAAsE;YACtE,IAAI,CAAC,KAAK,GAAG,IAAA,sBAAW,EAAC,IAAA,WAAI,EAAC,QAAQ,EAAE,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;SAC7D;IACH,CAAC;IAED;;OAEG;IACH,KA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OAAO,EAAC,CAAC,CAAC;SACtD;QAED,IAAI,IAAA,YAAK,EAAC,GAAG,CAAC,CAAC,GAAG,KAAK,KAAK,IAAI,CAAC,MAAM,IAAA,qBAAU,EAAC,GAAG,GAAG,MAAM,CAAC,CAAC,EAAE;YAChE,MAAM,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC;YAC5B,MAAM,IAAA,qBAAU,EAAC,IAAI,EAAE,0BAA0B,MAAM,EAAE,CAAC,CAAC;SAC5D;IACH,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,aAAa,CAAC,IAAY,EAAE,IAAa;QAC7C,IAAI,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAChC,OAAO,IAAA,qBAAU,EAAC,IAAI,EAAE,IAAI,EAAE,EAAC,MAAM,EAAE,CAAC,EAAC,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,aAAa,CAAC,IAAY,EAAE,IAAY;QAC5C,IAAI,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAChC,OAAO,IAAA,qBAAU,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;CACF;AA5ID,kCA4IC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loopback/testlab",
|
|
3
3
|
"description": "A collection of test utilities we use to write LoopBack tests.",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.7",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"directory": "packages/testlab"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
|
-
"node": "14 || 16 ||
|
|
16
|
+
"node": "14 || 16 || 18 || 19"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "lb-tsc",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@hapi/shot": "^6.0.0",
|
|
38
|
-
"@types/express": "^4.17.
|
|
38
|
+
"@types/express": "^4.17.15",
|
|
39
39
|
"@types/fs-extra": "^9.0.13",
|
|
40
40
|
"@types/shot": "^4.0.1",
|
|
41
41
|
"@types/sinon": "^10.0.13",
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"fs-extra": "^10.1.0",
|
|
45
45
|
"oas-validator": "^5.0.8",
|
|
46
46
|
"should": "^13.2.3",
|
|
47
|
-
"sinon": "^
|
|
48
|
-
"supertest": "^6.3.
|
|
47
|
+
"sinon": "^15.0.1",
|
|
48
|
+
"supertest": "^6.3.3",
|
|
49
49
|
"tslib": "^2.4.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@loopback/build": "^9.0.
|
|
53
|
-
"@loopback/eslint-config": "^13.0.
|
|
54
|
-
"@types/node": "^14.18.
|
|
52
|
+
"@loopback/build": "^9.0.7",
|
|
53
|
+
"@loopback/eslint-config": "^13.0.7",
|
|
54
|
+
"@types/node": "^14.18.36"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "06cbcba72ceb28ab5033bae80cc5504c80ac53c2"
|
|
57
57
|
}
|