@warp-drive/holodeck 0.1.0-alpha.16 → 0.1.0-alpha.18
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 +19 -0
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -126,9 +126,28 @@ function setupHolodeckFetch(owner, request) {
|
|
|
126
126
|
}
|
|
127
127
|
const queryForTest = `${firstChar}__xTestId=${test.id}&__xTestRequestNumber=${test.request[method][url]++}`;
|
|
128
128
|
request.url = url + queryForTest;
|
|
129
|
+
request.method = method;
|
|
129
130
|
request.mode = 'cors';
|
|
130
131
|
request.credentials = 'omit';
|
|
131
132
|
request.referrerPolicy = '';
|
|
133
|
+
|
|
134
|
+
// since holodeck currently runs on a separate port
|
|
135
|
+
// and we don't want to trigger cors pre-flight
|
|
136
|
+
// we convert PUT to POST to keep the request in the
|
|
137
|
+
// "simple" cors category.
|
|
138
|
+
// if (request.method === 'PUT') {
|
|
139
|
+
// request.method = 'POST';
|
|
140
|
+
// }
|
|
141
|
+
|
|
142
|
+
const headers = new Headers(request.headers);
|
|
143
|
+
if (headers.has('Content-Type')) {
|
|
144
|
+
// under the rules of simple-cors, content-type can only be
|
|
145
|
+
// one of three things, none of which are what folks typically
|
|
146
|
+
// set this to. Since holodeck always expects body to be JSON
|
|
147
|
+
// this "just works".
|
|
148
|
+
headers.set('Content-Type', 'text/plain');
|
|
149
|
+
request.headers = headers;
|
|
150
|
+
}
|
|
132
151
|
return {
|
|
133
152
|
request,
|
|
134
153
|
queryForTest
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warp-drive/holodeck",
|
|
3
3
|
"description": "⚡️ Simple, Fast HTTP Mocking for Tests",
|
|
4
|
-
"version": "0.1.0-alpha.
|
|
4
|
+
"version": "0.1.0-alpha.18",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Chris Thoburn <runspired@users.noreply.github.com>",
|
|
7
7
|
"repository": {
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"ensure-cert": "./server/ensure-cert.js"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@warp-drive/utilities": "5.8.0-alpha.
|
|
43
|
-
"@warp-drive/legacy": "5.8.0-alpha.
|
|
44
|
-
"@warp-drive/core": "5.8.0-alpha.
|
|
42
|
+
"@warp-drive/utilities": "5.8.0-alpha.18",
|
|
43
|
+
"@warp-drive/legacy": "5.8.0-alpha.18",
|
|
44
|
+
"@warp-drive/core": "5.8.0-alpha.18"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|
|
47
47
|
"@warp-drive/utilities": {
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"@babel/preset-env": "^7.28.3",
|
|
58
58
|
"@babel/preset-typescript": "^7.27.1",
|
|
59
59
|
"@babel/runtime": "^7.28.3",
|
|
60
|
-
"@warp-drive/utilities": "5.8.0-alpha.
|
|
61
|
-
"@warp-drive/legacy": "5.8.0-alpha.
|
|
62
|
-
"@warp-drive/core": "5.8.0-alpha.
|
|
63
|
-
"@warp-drive/internal-config": "5.8.0-alpha.
|
|
60
|
+
"@warp-drive/utilities": "5.8.0-alpha.18",
|
|
61
|
+
"@warp-drive/legacy": "5.8.0-alpha.18",
|
|
62
|
+
"@warp-drive/core": "5.8.0-alpha.18",
|
|
63
|
+
"@warp-drive/internal-config": "5.8.0-alpha.18",
|
|
64
64
|
"vite": "^7.1.3"
|
|
65
65
|
},
|
|
66
66
|
"exports": {
|