@specific.dev/spectest 0.28.0 → 0.28.1
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/browser.d.ts +2 -2
- package/dist/browser.js +1 -1
- package/dist/components/replayFake.js +2 -2
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/browser.d.ts
CHANGED
|
@@ -154,8 +154,8 @@ export interface Browser {
|
|
|
154
154
|
/**
|
|
155
155
|
* Capture a PNG screenshot of the viewport and upload it as a downloadable
|
|
156
156
|
* **artifact**. Resolves to the artifact's `art_…` id — fetch it locally
|
|
157
|
-
* with `spectest artifact download <id>`. Eval-only (`
|
|
158
|
-
*
|
|
157
|
+
* with `spectest artifact download <id>`. Eval-only (`spectest env eval`);
|
|
158
|
+
* throws with a clear message during test runs.
|
|
159
159
|
*/
|
|
160
160
|
screenshot(): Promise<string>;
|
|
161
161
|
/**
|
package/dist/browser.js
CHANGED
|
@@ -1187,7 +1187,7 @@ function buildBackend(holder, recorder, buildOpts) {
|
|
|
1187
1187
|
const register = recorder?.registerArtifact;
|
|
1188
1188
|
if (!register) {
|
|
1189
1189
|
throw new Error("screenshot() uploads the capture as a downloadable artifact and is " +
|
|
1190
|
-
"currently only available inside an eval (
|
|
1190
|
+
"currently only available inside an eval (`spectest env eval`) — " +
|
|
1191
1191
|
"it cannot be used in test runs.");
|
|
1192
1192
|
}
|
|
1193
1193
|
// Raw CDP rather than page.screenshot(): captures the viewport
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// - RECORD (MITM): the request is forwarded to the REAL host and the
|
|
20
20
|
// request/response pair is captured (decoded, redacted), and the real
|
|
21
21
|
// response is returned to the app so a manual session behaves like
|
|
22
|
-
// production. This runs under `
|
|
22
|
+
// production. This runs under `spectest env eval` against a manual env.
|
|
23
23
|
//
|
|
24
24
|
// Because the fake's hostname IS the real host, the in-VM resolver points
|
|
25
25
|
// that name at the daemon — so a naive `fetch("https://api.stripe.com")`
|
|
@@ -509,7 +509,7 @@ export function replayFake(opts) {
|
|
|
509
509
|
if (missing.length > 0) {
|
|
510
510
|
const refs = [...new Set(missing)];
|
|
511
511
|
return new Response(`replayFake(${opts.name}): secret(s) ${JSON.stringify(refs)} were not supplied ` +
|
|
512
|
-
`(configure them on the project's Secrets page, and record via
|
|
512
|
+
`(configure them on the project's Secrets page, and record via \`spectest env eval\`).\n`, { status: 599, headers: { "content-type": "text/plain" } });
|
|
513
513
|
}
|
|
514
514
|
// Resolve the REAL host's IP via an external resolver so we don't loop
|
|
515
515
|
// back into the daemon (the in-VM resolver answers our own gateway for
|
package/dist/index.d.ts
CHANGED
|
@@ -612,7 +612,7 @@ export interface FakeContext {
|
|
|
612
612
|
* is strongly typed.
|
|
613
613
|
*/
|
|
614
614
|
export interface TestCase<T = unknown, S extends ServicesMap = ServicesMap, F extends FakesMap = FakesMap> {
|
|
615
|
-
/** Stable id (slug of name). Used in
|
|
615
|
+
/** Stable id (slug of name). Used in run results and CLI flags. */
|
|
616
616
|
readonly id: string;
|
|
617
617
|
readonly name: string;
|
|
618
618
|
/** Parent test, if any. Single-parent for now. */
|