@stravigor/testing 0.1.0 → 0.4.0
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/CHANGELOG.md +7 -0
- package/package.json +3 -3
- package/src/test_case.ts +9 -6
package/CHANGELOG.md
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stravigor/testing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Testing utilities for the Strav framework",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
".": "./src/index.ts",
|
|
9
9
|
"./*": "./src/*.ts"
|
|
10
10
|
},
|
|
11
|
-
"files": ["src/", "package.json", "tsconfig.json"],
|
|
11
|
+
"files": ["src/", "package.json", "tsconfig.json", "CHANGELOG.md"],
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@stravigor/core": "0.
|
|
13
|
+
"@stravigor/core": "0.3.3"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"test": "bun test tests/",
|
package/src/test_case.ts
CHANGED
|
@@ -116,7 +116,9 @@ export class TestCase {
|
|
|
116
116
|
if (this._reserved) {
|
|
117
117
|
try {
|
|
118
118
|
await this._reserved`ROLLBACK`
|
|
119
|
-
} catch {
|
|
119
|
+
} catch {
|
|
120
|
+
/* ignore */
|
|
121
|
+
}
|
|
120
122
|
this._reserved.release()
|
|
121
123
|
this._reserved = null
|
|
122
124
|
}
|
|
@@ -252,11 +254,12 @@ export class TestCase {
|
|
|
252
254
|
if (body !== undefined) merged['Content-Type'] = 'application/json'
|
|
253
255
|
|
|
254
256
|
if (headers) {
|
|
255
|
-
const entries =
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
257
|
+
const entries =
|
|
258
|
+
headers instanceof Headers
|
|
259
|
+
? Object.fromEntries(headers.entries())
|
|
260
|
+
: Array.isArray(headers)
|
|
261
|
+
? Object.fromEntries(headers)
|
|
262
|
+
: headers
|
|
260
263
|
Object.assign(merged, entries)
|
|
261
264
|
}
|
|
262
265
|
|