Initial boiler plate project
This commit is contained in:
11
node_modules/next/dist/experimental/testmode/context.d.ts
generated
vendored
Normal file
11
node_modules/next/dist/experimental/testmode/context.d.ts
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export interface TestReqInfo {
|
||||
url: string;
|
||||
proxyPort: number;
|
||||
testData: string;
|
||||
}
|
||||
export interface TestRequestReader<R> {
|
||||
url(req: R): string;
|
||||
header(req: R, name: string): string | null;
|
||||
}
|
||||
export declare function withRequest<R, T>(req: R, reader: TestRequestReader<R>, fn: () => T): T;
|
||||
export declare function getTestReqInfo<R>(req?: R, reader?: TestRequestReader<R>): TestReqInfo | undefined;
|
||||
57
node_modules/next/dist/experimental/testmode/context.js
generated
vendored
Normal file
57
node_modules/next/dist/experimental/testmode/context.js
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
getTestReqInfo: null,
|
||||
withRequest: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
getTestReqInfo: function() {
|
||||
return getTestReqInfo;
|
||||
},
|
||||
withRequest: function() {
|
||||
return withRequest;
|
||||
}
|
||||
});
|
||||
const _nodeasync_hooks = require("node:async_hooks");
|
||||
const testStorage = new _nodeasync_hooks.AsyncLocalStorage();
|
||||
function extractTestInfoFromRequest(req, reader) {
|
||||
const proxyPortHeader = reader.header(req, "next-test-proxy-port");
|
||||
if (!proxyPortHeader) {
|
||||
return undefined;
|
||||
}
|
||||
const url = reader.url(req);
|
||||
const proxyPort = Number(proxyPortHeader);
|
||||
const testData = reader.header(req, "next-test-data") || "";
|
||||
return {
|
||||
url,
|
||||
proxyPort,
|
||||
testData
|
||||
};
|
||||
}
|
||||
function withRequest(req, reader, fn) {
|
||||
const testReqInfo = extractTestInfoFromRequest(req, reader);
|
||||
if (!testReqInfo) {
|
||||
return fn();
|
||||
}
|
||||
return testStorage.run(testReqInfo, fn);
|
||||
}
|
||||
function getTestReqInfo(req, reader) {
|
||||
const testReqInfo = testStorage.getStore();
|
||||
if (testReqInfo) {
|
||||
return testReqInfo;
|
||||
}
|
||||
if (req && reader) {
|
||||
return extractTestInfoFromRequest(req, reader);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=context.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/context.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/context.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/experimental/testmode/context.ts"],"names":["getTestReqInfo","withRequest","testStorage","AsyncLocalStorage","extractTestInfoFromRequest","req","reader","proxyPortHeader","header","undefined","url","proxyPort","Number","testData","fn","testReqInfo","run","getStore"],"mappings":";;;;;;;;;;;;;;;IAyCgBA,cAAc;eAAdA;;IAZAC,WAAW;eAAXA;;;iCA7BkB;AAalC,MAAMC,cAAc,IAAIC,kCAAiB;AAEzC,SAASC,2BACPC,GAAM,EACNC,MAA4B;IAE5B,MAAMC,kBAAkBD,OAAOE,MAAM,CAACH,KAAK;IAC3C,IAAI,CAACE,iBAAiB;QACpB,OAAOE;IACT;IACA,MAAMC,MAAMJ,OAAOI,GAAG,CAACL;IACvB,MAAMM,YAAYC,OAAOL;IACzB,MAAMM,WAAWP,OAAOE,MAAM,CAACH,KAAK,qBAAqB;IACzD,OAAO;QAAEK;QAAKC;QAAWE;IAAS;AACpC;AAEO,SAASZ,YACdI,GAAM,EACNC,MAA4B,EAC5BQ,EAAW;IAEX,MAAMC,cAAcX,2BAA2BC,KAAKC;IACpD,IAAI,CAACS,aAAa;QAChB,OAAOD;IACT;IACA,OAAOZ,YAAYc,GAAG,CAACD,aAAaD;AACtC;AAEO,SAASd,eACdK,GAAO,EACPC,MAA6B;IAE7B,MAAMS,cAAcb,YAAYe,QAAQ;IACxC,IAAIF,aAAa;QACf,OAAOA;IACT;IACA,IAAIV,OAAOC,QAAQ;QACjB,OAAOF,2BAA2BC,KAAKC;IACzC;IACA,OAAOG;AACT"}
|
||||
6
node_modules/next/dist/experimental/testmode/fetch.d.ts
generated
vendored
Normal file
6
node_modules/next/dist/experimental/testmode/fetch.d.ts
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
import { type TestRequestReader } from './context';
|
||||
type Fetch = typeof fetch;
|
||||
export declare const reader: TestRequestReader<Request>;
|
||||
export declare function handleFetch(originalFetch: Fetch, request: Request): Promise<Response>;
|
||||
export declare function interceptFetch(originalFetch: Fetch): () => void;
|
||||
export {};
|
||||
133
node_modules/next/dist/experimental/testmode/fetch.js
generated
vendored
Normal file
133
node_modules/next/dist/experimental/testmode/fetch.js
generated
vendored
Normal file
@ -0,0 +1,133 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
handleFetch: null,
|
||||
interceptFetch: null,
|
||||
reader: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
handleFetch: function() {
|
||||
return handleFetch;
|
||||
},
|
||||
interceptFetch: function() {
|
||||
return interceptFetch;
|
||||
},
|
||||
reader: function() {
|
||||
return reader;
|
||||
}
|
||||
});
|
||||
const _context = require("./context");
|
||||
const reader = {
|
||||
url (req) {
|
||||
return req.url;
|
||||
},
|
||||
header (req, name) {
|
||||
return req.headers.get(name);
|
||||
}
|
||||
};
|
||||
function getTestStack() {
|
||||
let stack = (new Error().stack ?? "").split("\n");
|
||||
// Skip the first line and find first non-empty line.
|
||||
for(let i = 1; i < stack.length; i++){
|
||||
if (stack[i].length > 0) {
|
||||
stack = stack.slice(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Filter out franmework lines.
|
||||
stack = stack.filter((f)=>!f.includes("/next/dist/"));
|
||||
// At most 5 lines.
|
||||
stack = stack.slice(0, 5);
|
||||
// Cleanup some internal info and trim.
|
||||
stack = stack.map((s)=>s.replace("webpack-internal:///(rsc)/", "").trim());
|
||||
return stack.join(" ");
|
||||
}
|
||||
async function buildProxyRequest(testData, request) {
|
||||
const { url, method, headers, body, cache, credentials, integrity, mode, redirect, referrer, referrerPolicy } = request;
|
||||
return {
|
||||
testData,
|
||||
api: "fetch",
|
||||
request: {
|
||||
url,
|
||||
method,
|
||||
headers: [
|
||||
...Array.from(headers),
|
||||
[
|
||||
"next-test-stack",
|
||||
getTestStack()
|
||||
]
|
||||
],
|
||||
body: body ? Buffer.from(await request.arrayBuffer()).toString("base64") : null,
|
||||
cache,
|
||||
credentials,
|
||||
integrity,
|
||||
mode,
|
||||
redirect,
|
||||
referrer,
|
||||
referrerPolicy
|
||||
}
|
||||
};
|
||||
}
|
||||
function buildResponse(proxyResponse) {
|
||||
const { status, headers, body } = proxyResponse.response;
|
||||
return new Response(body ? Buffer.from(body, "base64") : null, {
|
||||
status,
|
||||
headers: new Headers(headers)
|
||||
});
|
||||
}
|
||||
async function handleFetch(originalFetch, request) {
|
||||
const testInfo = (0, _context.getTestReqInfo)(request, reader);
|
||||
if (!testInfo) {
|
||||
// Passthrough non-test requests.
|
||||
return originalFetch(request);
|
||||
}
|
||||
const { testData, proxyPort } = testInfo;
|
||||
const proxyRequest = await buildProxyRequest(testData, request);
|
||||
const resp = await originalFetch(`http://localhost:${proxyPort}`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(proxyRequest),
|
||||
next: {
|
||||
// @ts-ignore
|
||||
internal: true
|
||||
}
|
||||
});
|
||||
if (!resp.ok) {
|
||||
throw new Error(`Proxy request failed: ${resp.status}`);
|
||||
}
|
||||
const proxyResponse = await resp.json();
|
||||
const { api } = proxyResponse;
|
||||
switch(api){
|
||||
case "continue":
|
||||
return originalFetch(request);
|
||||
case "abort":
|
||||
case "unhandled":
|
||||
throw new Error(`Proxy request aborted [${request.method} ${request.url}]`);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return buildResponse(proxyResponse);
|
||||
}
|
||||
function interceptFetch(originalFetch) {
|
||||
global.fetch = function testFetch(input, init) {
|
||||
var _init_next;
|
||||
// Passthrough internal requests.
|
||||
// @ts-ignore
|
||||
if (init == null ? void 0 : (_init_next = init.next) == null ? void 0 : _init_next.internal) {
|
||||
return originalFetch(input, init);
|
||||
}
|
||||
return handleFetch(originalFetch, new Request(input, init));
|
||||
};
|
||||
return ()=>{
|
||||
global.fetch = originalFetch;
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=fetch.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/fetch.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/fetch.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/experimental/testmode/fetch.ts"],"names":["handleFetch","interceptFetch","reader","url","req","header","name","headers","get","getTestStack","stack","Error","split","i","length","slice","filter","f","includes","map","s","replace","trim","join","buildProxyRequest","testData","request","method","body","cache","credentials","integrity","mode","redirect","referrer","referrerPolicy","api","Array","from","Buffer","arrayBuffer","toString","buildResponse","proxyResponse","status","response","Response","Headers","originalFetch","testInfo","getTestReqInfo","proxyPort","proxyRequest","resp","JSON","stringify","next","internal","ok","json","global","fetch","testFetch","input","init","Request"],"mappings":";;;;;;;;;;;;;;;;IAoFsBA,WAAW;eAAXA;;IAyCNC,cAAc;eAAdA;;IAlHHC,MAAM;eAANA;;;yBAN0C;AAMhD,MAAMA,SAAqC;IAChDC,KAAIC,GAAG;QACL,OAAOA,IAAID,GAAG;IAChB;IACAE,QAAOD,GAAG,EAAEE,IAAI;QACd,OAAOF,IAAIG,OAAO,CAACC,GAAG,CAACF;IACzB;AACF;AAEA,SAASG;IACP,IAAIC,QAAQ,AAAC,CAAA,IAAIC,QAAQD,KAAK,IAAI,EAAC,EAAGE,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BtB,OAAgB;IAEhB,MAAMuB,WAAWC,IAAAA,uBAAc,EAACxB,SAASxB;IACzC,IAAI,CAAC+C,UAAU;QACb,iCAAiC;QACjC,OAAOD,cAActB;IACvB;IAEA,MAAM,EAAED,QAAQ,EAAE0B,SAAS,EAAE,GAAGF;IAChC,MAAMG,eAAe,MAAM5B,kBAAkBC,UAAUC;IAEvD,MAAM2B,OAAO,MAAML,cAAc,CAAC,iBAAiB,EAAEG,UAAU,CAAC,EAAE;QAChExB,QAAQ;QACRC,MAAM0B,KAAKC,SAAS,CAACH;QACrBI,MAAM;YACJ,aAAa;YACbC,UAAU;QACZ;IACF;IACA,IAAI,CAACJ,KAAKK,EAAE,EAAE;QACZ,MAAM,IAAI/C,MAAM,CAAC,sBAAsB,EAAE0C,KAAKT,MAAM,CAAC,CAAC;IACxD;IAEA,MAAMD,gBAAiB,MAAMU,KAAKM,IAAI;IACtC,MAAM,EAAEvB,GAAG,EAAE,GAAGO;IAChB,OAAQP;QACN,KAAK;YACH,OAAOY,cAActB;QACvB,KAAK;QACL,KAAK;YACH,MAAM,IAAIf,MACR,CAAC,uBAAuB,EAAEe,QAAQC,MAAM,CAAC,CAAC,EAAED,QAAQvB,GAAG,CAAC,CAAC,CAAC;QAE9D;YACE;IACJ;IACA,OAAOuC,cAAcC;AACvB;AAEO,SAAS1C,eAAe+C,aAAoB;IACjDY,OAAOC,KAAK,GAAG,SAASC,UACtBC,KAAoB,EACpBC,IAAmB;YAIfA;QAFJ,iCAAiC;QACjC,aAAa;QACb,IAAIA,yBAAAA,aAAAA,KAAMR,IAAI,qBAAVQ,WAAYP,QAAQ,EAAE;YACxB,OAAOT,cAAce,OAAOC;QAC9B;QACA,OAAOhE,YAAYgD,eAAe,IAAIiB,QAAQF,OAAOC;IACvD;IACA,OAAO;QACLJ,OAAOC,KAAK,GAAGb;IACjB;AACF"}
|
||||
3
node_modules/next/dist/experimental/testmode/httpget.d.ts
generated
vendored
Normal file
3
node_modules/next/dist/experimental/testmode/httpget.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
type Fetch = typeof fetch;
|
||||
export declare function interceptHttpGet(originalFetch: Fetch): () => void;
|
||||
export {};
|
||||
26
node_modules/next/dist/experimental/testmode/httpget.js
generated
vendored
Normal file
26
node_modules/next/dist/experimental/testmode/httpget.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "interceptHttpGet", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return interceptHttpGet;
|
||||
}
|
||||
});
|
||||
const _ClientRequest = require("next/dist/compiled/@mswjs/interceptors/ClientRequest");
|
||||
const _fetch = require("./fetch");
|
||||
function interceptHttpGet(originalFetch) {
|
||||
const clientRequestInterceptor = new _ClientRequest.ClientRequestInterceptor();
|
||||
clientRequestInterceptor.on("request", async ({ request })=>{
|
||||
const response = await (0, _fetch.handleFetch)(originalFetch, request);
|
||||
request.respondWith(response);
|
||||
});
|
||||
clientRequestInterceptor.apply();
|
||||
// Cleanup.
|
||||
return ()=>{
|
||||
clientRequestInterceptor.dispose();
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=httpget.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/httpget.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/httpget.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/experimental/testmode/httpget.ts"],"names":["interceptHttpGet","originalFetch","clientRequestInterceptor","ClientRequestInterceptor","on","request","response","handleFetch","respondWith","apply","dispose"],"mappings":";;;;+BAKgBA;;;eAAAA;;;+BALyB;uBACb;AAIrB,SAASA,iBAAiBC,aAAoB;IACnD,MAAMC,2BAA2B,IAAIC,uCAAwB;IAC7DD,yBAAyBE,EAAE,CAAC,WAAW,OAAO,EAAEC,OAAO,EAAE;QACvD,MAAMC,WAAW,MAAMC,IAAAA,kBAAW,EAACN,eAAeI;QAClDA,QAAQG,WAAW,CAACF;IACtB;IACAJ,yBAAyBO,KAAK;IAE9B,WAAW;IACX,OAAO;QACLP,yBAAyBQ,OAAO;IAClC;AACF"}
|
||||
18
node_modules/next/dist/experimental/testmode/playwright/index.d.ts
generated
vendored
Normal file
18
node_modules/next/dist/experimental/testmode/playwright/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
import * as base from '@playwright/test';
|
||||
import type { NextFixture } from './next-fixture';
|
||||
import type { NextOptions } from './next-options';
|
||||
import type { NextWorkerFixture } from './next-worker-fixture';
|
||||
export * from '@playwright/test';
|
||||
export type { NextFixture, NextOptions };
|
||||
export type { FetchHandlerResult } from '../proxy';
|
||||
export interface NextOptionsConfig {
|
||||
nextOptions?: NextOptions;
|
||||
}
|
||||
export declare function defineConfig<T extends NextOptionsConfig, W>(config: base.PlaywrightTestConfig<T, W>): base.PlaywrightTestConfig<T, W>;
|
||||
export declare const test: base.TestType<base.PlaywrightTestArgs & base.PlaywrightTestOptions & {
|
||||
next: NextFixture;
|
||||
nextOptions: NextOptions;
|
||||
}, base.PlaywrightWorkerArgs & base.PlaywrightWorkerOptions & {
|
||||
_nextWorker: NextWorkerFixture;
|
||||
}>;
|
||||
export default test;
|
||||
119
node_modules/next/dist/experimental/testmode/playwright/index.js
generated
vendored
Normal file
119
node_modules/next/dist/experimental/testmode/playwright/index.js
generated
vendored
Normal file
@ -0,0 +1,119 @@
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
default: null,
|
||||
defineConfig: null,
|
||||
test: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
default: function() {
|
||||
return _default;
|
||||
},
|
||||
defineConfig: function() {
|
||||
return defineConfig;
|
||||
},
|
||||
test: function() {
|
||||
return test;
|
||||
}
|
||||
});
|
||||
0 && __export(require("@playwright/test"));
|
||||
const _test = /*#__PURE__*/ _interop_require_wildcard(_export_star(require("@playwright/test"), exports));
|
||||
const _nextworkerfixture = require("./next-worker-fixture");
|
||||
const _nextfixture = require("./next-fixture");
|
||||
function _export_star(from, to) {
|
||||
Object.keys(from).forEach(function(k) {
|
||||
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
||||
Object.defineProperty(to, k, {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return from[k];
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return from;
|
||||
}
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {
|
||||
__proto__: null
|
||||
};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
function defineConfig(config) {
|
||||
return _test.defineConfig(config);
|
||||
}
|
||||
const test = _test.test.extend({
|
||||
nextOptions: [
|
||||
{
|
||||
fetchLoopback: false
|
||||
},
|
||||
{
|
||||
option: true
|
||||
}
|
||||
],
|
||||
_nextWorker: [
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
async ({}, use)=>{
|
||||
await (0, _nextworkerfixture.applyNextWorkerFixture)(use);
|
||||
},
|
||||
{
|
||||
scope: "worker",
|
||||
auto: true
|
||||
}
|
||||
],
|
||||
next: async ({ nextOptions, _nextWorker, page }, use, testInfo)=>{
|
||||
await (0, _nextfixture.applyNextFixture)(use, {
|
||||
testInfo,
|
||||
nextWorker: _nextWorker,
|
||||
page,
|
||||
nextOptions
|
||||
});
|
||||
}
|
||||
});
|
||||
const _default = test;
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/playwright/index.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/playwright/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/experimental/testmode/playwright/index.ts"],"names":["defineConfig","test","config","base","extend","nextOptions","fetchLoopback","option","_nextWorker","use","applyNextWorkerFixture","scope","auto","next","page","testInfo","applyNextFixture","nextWorker"],"mappings":"AAAA,6DAA6D;;;;;;;;;;;;;;;;;IAmD7D,OAAmB;eAAnB;;IA9BgBA,YAAY;eAAZA;;IAMHC,IAAI;eAAJA;;;;2EA1BS;mCAIiB;6BACN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAe1B,SAASD,aACdE,MAAoC;IAEpC,OAAOC,MAAKH,YAAY,CAAIE;AAC9B;AAEO,MAAMD,OAAOE,MAAKF,IAAI,CAACG,MAAM,CAGlC;IACAC,aAAa;QAAC;YAAEC,eAAe;QAAM;QAAG;YAAEC,QAAQ;QAAK;KAAE;IAEzDC,aAAa;QACX,4CAA4C;QAC5C,OAAO,EAAE,EAAEC;YACT,MAAMC,IAAAA,yCAAsB,EAACD;QAC/B;QACA;YAAEE,OAAO;YAAUC,MAAM;QAAK;KAC/B;IAEDC,MAAM,OAAO,EAAER,WAAW,EAAEG,WAAW,EAAEM,IAAI,EAAE,EAAEL,KAAKM;QACpD,MAAMC,IAAAA,6BAAgB,EAACP,KAAK;YAC1BM;YACAE,YAAYT;YACZM;YACAT;QACF;IACF;AACF;MAEA,WAAeJ"}
|
||||
20
node_modules/next/dist/experimental/testmode/playwright/msw.d.ts
generated
vendored
Normal file
20
node_modules/next/dist/experimental/testmode/playwright/msw.d.ts
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
import { defineConfig } from './index';
|
||||
import type { NextFixture } from './next-fixture';
|
||||
import { type RequestHandler } from 'msw';
|
||||
export * from 'msw';
|
||||
export * from '@playwright/test';
|
||||
export type { NextFixture };
|
||||
export { defineConfig };
|
||||
export interface MswFixture {
|
||||
use: (...handlers: RequestHandler[]) => void;
|
||||
}
|
||||
export declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & {
|
||||
next: NextFixture;
|
||||
nextOptions: import("./next-options").NextOptions;
|
||||
} & {
|
||||
msw: MswFixture;
|
||||
mswHandlers: RequestHandler[];
|
||||
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & {
|
||||
_nextWorker: import("./next-worker-fixture").NextWorkerFixture;
|
||||
}>;
|
||||
export default test;
|
||||
121
node_modules/next/dist/experimental/testmode/playwright/msw.js
generated
vendored
Normal file
121
node_modules/next/dist/experimental/testmode/playwright/msw.js
generated
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
default: null,
|
||||
defineConfig: null,
|
||||
test: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
default: function() {
|
||||
return _default;
|
||||
},
|
||||
defineConfig: function() {
|
||||
return _index.defineConfig;
|
||||
},
|
||||
test: function() {
|
||||
return test;
|
||||
}
|
||||
});
|
||||
0 && __export(require("msw")) && __export(require("@playwright/test"));
|
||||
const _index = require("./index");
|
||||
const _msw = _export_star(require("msw"), exports);
|
||||
const _stricteventemitter = require("strict-event-emitter");
|
||||
_export_star(require("@playwright/test"), exports);
|
||||
function _export_star(from, to) {
|
||||
Object.keys(from).forEach(function(k) {
|
||||
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
||||
Object.defineProperty(to, k, {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return from[k];
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return from;
|
||||
}
|
||||
const test = _index.test.extend({
|
||||
mswHandlers: [
|
||||
[],
|
||||
{
|
||||
option: true
|
||||
}
|
||||
],
|
||||
msw: [
|
||||
async ({ next, mswHandlers }, use)=>{
|
||||
const handlers = [
|
||||
...mswHandlers
|
||||
];
|
||||
const emitter = new _stricteventemitter.Emitter();
|
||||
next.onFetch(async (request)=>{
|
||||
const { body, method, headers, credentials, cache, redirect, integrity, keepalive, mode, destination, referrer, referrerPolicy } = request;
|
||||
const mockedRequest = new _msw.MockedRequest(new URL(request.url), {
|
||||
body: body ? await request.arrayBuffer() : undefined,
|
||||
method,
|
||||
headers: Object.fromEntries(headers),
|
||||
credentials,
|
||||
cache,
|
||||
redirect,
|
||||
integrity,
|
||||
keepalive,
|
||||
mode,
|
||||
destination,
|
||||
referrer,
|
||||
referrerPolicy
|
||||
});
|
||||
let isUnhandled = false;
|
||||
let isPassthrough = false;
|
||||
let mockedResponse;
|
||||
await (0, _msw.handleRequest)(mockedRequest, handlers.slice(0), {
|
||||
onUnhandledRequest: ()=>{
|
||||
isUnhandled = true;
|
||||
}
|
||||
}, emitter, {
|
||||
onPassthroughResponse: ()=>{
|
||||
isPassthrough = true;
|
||||
},
|
||||
onMockedResponse: (r)=>{
|
||||
mockedResponse = r;
|
||||
}
|
||||
});
|
||||
if (isUnhandled) {
|
||||
return undefined;
|
||||
}
|
||||
if (isPassthrough) {
|
||||
return "continue";
|
||||
}
|
||||
if (mockedResponse) {
|
||||
const { status, headers: responseHeaders, body: responseBody, delay } = mockedResponse;
|
||||
if (delay) {
|
||||
await new Promise((resolve)=>setTimeout(resolve, delay));
|
||||
}
|
||||
return new Response(responseBody, {
|
||||
status,
|
||||
headers: new Headers(responseHeaders)
|
||||
});
|
||||
}
|
||||
return "abort";
|
||||
});
|
||||
await use({
|
||||
use: (...newHandlers)=>{
|
||||
handlers.unshift(...newHandlers);
|
||||
}
|
||||
});
|
||||
handlers.length = 0;
|
||||
},
|
||||
{
|
||||
auto: true
|
||||
}
|
||||
]
|
||||
});
|
||||
const _default = test;
|
||||
|
||||
//# sourceMappingURL=msw.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/playwright/msw.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/playwright/msw.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/experimental/testmode/playwright/msw.ts"],"names":["defineConfig","test","base","extend","mswHandlers","option","msw","next","use","handlers","emitter","Emitter","onFetch","request","body","method","headers","credentials","cache","redirect","integrity","keepalive","mode","destination","referrer","referrerPolicy","mockedRequest","MockedRequest","URL","url","arrayBuffer","undefined","Object","fromEntries","isUnhandled","isPassthrough","mockedResponse","handleRequest","slice","onUnhandledRequest","onPassthroughResponse","onMockedResponse","r","status","responseHeaders","responseBody","delay","Promise","resolve","setTimeout","Response","Headers","newHandlers","unshift","length","auto"],"mappings":";;;;;;;;;;;;;;;;IA2HA,OAA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EACxB9B,MAAM+B,YAAY,EAClBC,KAAK,EACN,GAAGV;oBACJ,IAAIU,OAAO;wBACT,MAAM,IAAIC,QAAQ,CAACC,UAAYC,WAAWD,SAASF;oBACrD;oBACA,OAAO,IAAII,SAASL,cAAc;wBAChCF;wBACA3B,SAAS,IAAImC,QAAQP;oBACvB;gBACF;gBAEA,OAAO;YACT;YAEA,MAAMpC,IAAI;gBACRA,KAAK,CAAC,GAAG4C;oBACP3C,SAAS4C,OAAO,IAAID;gBACtB;YACF;YAEA3C,SAAS6C,MAAM,GAAG;QACpB;QACA;YAAEC,MAAM;QAAK;KACd;AACH;MAEA,WAAetD"}
|
||||
12
node_modules/next/dist/experimental/testmode/playwright/next-fixture.d.ts
generated
vendored
Normal file
12
node_modules/next/dist/experimental/testmode/playwright/next-fixture.d.ts
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import type { Page, TestInfo } from '@playwright/test';
|
||||
import type { NextWorkerFixture, FetchHandler } from './next-worker-fixture';
|
||||
import type { NextOptions } from './next-options';
|
||||
export interface NextFixture {
|
||||
onFetch: (handler: FetchHandler) => void;
|
||||
}
|
||||
export declare function applyNextFixture(use: (fixture: NextFixture) => Promise<void>, { testInfo, nextOptions, nextWorker, page, }: {
|
||||
testInfo: TestInfo;
|
||||
nextOptions: NextOptions;
|
||||
nextWorker: NextWorkerFixture;
|
||||
page: Page;
|
||||
}): Promise<void>;
|
||||
56
node_modules/next/dist/experimental/testmode/playwright/next-fixture.js
generated
vendored
Normal file
56
node_modules/next/dist/experimental/testmode/playwright/next-fixture.js
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "applyNextFixture", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return applyNextFixture;
|
||||
}
|
||||
});
|
||||
const _pageroute = require("./page-route");
|
||||
const _report = require("./report");
|
||||
class NextFixtureImpl {
|
||||
constructor(testInfo, options, worker, page){
|
||||
this.testInfo = testInfo;
|
||||
this.options = options;
|
||||
this.worker = worker;
|
||||
this.page = page;
|
||||
this.fetchHandlers = [];
|
||||
this.testId = testInfo.testId;
|
||||
const testHeaders = {
|
||||
"Next-Test-Proxy-Port": String(worker.proxyPort),
|
||||
"Next-Test-Data": this.testId
|
||||
};
|
||||
const handleFetch = this.handleFetch.bind(this);
|
||||
worker.onFetch(this.testId, handleFetch);
|
||||
this.page.context().route("**", (route)=>(0, _pageroute.handleRoute)(route, page, testHeaders, handleFetch));
|
||||
}
|
||||
teardown() {
|
||||
this.worker.cleanupTest(this.testId);
|
||||
}
|
||||
onFetch(handler) {
|
||||
this.fetchHandlers.push(handler);
|
||||
}
|
||||
async handleFetch(request) {
|
||||
return (0, _report.reportFetch)(this.testInfo, request, async (req)=>{
|
||||
for (const handler of this.fetchHandlers.slice().reverse()){
|
||||
const result = await handler(req.clone());
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (this.options.fetchLoopback) {
|
||||
return fetch(req.clone());
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
}
|
||||
}
|
||||
async function applyNextFixture(use, { testInfo, nextOptions, nextWorker, page }) {
|
||||
const fixture = new NextFixtureImpl(testInfo, nextOptions, nextWorker, page);
|
||||
await use(fixture);
|
||||
fixture.teardown();
|
||||
}
|
||||
|
||||
//# sourceMappingURL=next-fixture.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/playwright/next-fixture.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/playwright/next-fixture.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/experimental/testmode/playwright/next-fixture.ts"],"names":["applyNextFixture","NextFixtureImpl","constructor","testInfo","options","worker","page","fetchHandlers","testId","testHeaders","String","proxyPort","handleFetch","bind","onFetch","context","route","handleRoute","teardown","cleanupTest","handler","push","request","reportFetch","req","slice","reverse","result","clone","fetchLoopback","fetch","und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E7B,QAAQ,EACR8B,WAAW,EACXC,UAAU,EACV5B,IAAI,EAML;IAED,MAAM6B,UAAU,IAAIlC,gBAAgBE,UAAU8B,aAAaC,YAAY5B;IAEvE,MAAM0B,IAAIG;IAEVA,QAAQjB,QAAQ;AAClB"}
|
||||
3
node_modules/next/dist/experimental/testmode/playwright/next-options.d.ts
generated
vendored
Normal file
3
node_modules/next/dist/experimental/testmode/playwright/next-options.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
export interface NextOptions {
|
||||
fetchLoopback?: boolean;
|
||||
}
|
||||
6
node_modules/next/dist/experimental/testmode/playwright/next-options.js
generated
vendored
Normal file
6
node_modules/next/dist/experimental/testmode/playwright/next-options.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
//# sourceMappingURL=next-options.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/playwright/next-options.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/playwright/next-options.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":[],"names":[],"mappings":""}
|
||||
8
node_modules/next/dist/experimental/testmode/playwright/next-worker-fixture.d.ts
generated
vendored
Normal file
8
node_modules/next/dist/experimental/testmode/playwright/next-worker-fixture.d.ts
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import type { FetchHandlerResult } from '../proxy';
|
||||
export type FetchHandler = (request: Request) => FetchHandlerResult | Promise<FetchHandlerResult>;
|
||||
export interface NextWorkerFixture {
|
||||
proxyPort: number;
|
||||
onFetch: (testId: string, handler: FetchHandler) => void;
|
||||
cleanupTest: (testId: string) => void;
|
||||
}
|
||||
export declare function applyNextWorkerFixture(use: (fixture: NextWorkerFixture) => Promise<void>): Promise<void>;
|
||||
49
node_modules/next/dist/experimental/testmode/playwright/next-worker-fixture.js
generated
vendored
Normal file
49
node_modules/next/dist/experimental/testmode/playwright/next-worker-fixture.js
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "applyNextWorkerFixture", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return applyNextWorkerFixture;
|
||||
}
|
||||
});
|
||||
const _proxy = require("../proxy");
|
||||
class NextWorkerFixtureImpl {
|
||||
async setup() {
|
||||
const server = await (0, _proxy.createProxyServer)({
|
||||
onFetch: this.handleProxyFetch.bind(this)
|
||||
});
|
||||
this.proxyPort = server.port;
|
||||
this.proxyServer = server;
|
||||
}
|
||||
teardown() {
|
||||
if (this.proxyServer) {
|
||||
this.proxyServer.close();
|
||||
this.proxyServer = null;
|
||||
}
|
||||
}
|
||||
cleanupTest(testId) {
|
||||
this.proxyFetchMap.delete(testId);
|
||||
}
|
||||
onFetch(testId, handler) {
|
||||
this.proxyFetchMap.set(testId, handler);
|
||||
}
|
||||
async handleProxyFetch(testId, request) {
|
||||
const handler = this.proxyFetchMap.get(testId);
|
||||
return handler == null ? void 0 : handler(request);
|
||||
}
|
||||
constructor(){
|
||||
this.proxyPort = 0;
|
||||
this.proxyServer = null;
|
||||
this.proxyFetchMap = new Map();
|
||||
}
|
||||
}
|
||||
async function applyNextWorkerFixture(use) {
|
||||
const fixture = new NextWorkerFixtureImpl();
|
||||
await fixture.setup();
|
||||
await use(fixture);
|
||||
fixture.teardown();
|
||||
}
|
||||
|
||||
//# sourceMappingURL=next-worker-fixture.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/playwright/next-worker-fixture.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/playwright/next-worker-fixture.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/experimental/testmode/playwright/next-worker-fixture.ts"],"names":["applyNextWorkerFixture","NextWorkerFixtureImpl","setup","server","createProxyServer","onFetch","handleProxyFetch","bind","proxyPort","port","proxyServer","teardown","close","cleanupTest","testId","proxyFetchMap","delete","handler","set","request","get","Map","use","fixture"],"mappings":";;;;+BAmDsBA;;;eAAAA;;;uBAlDY;AAYlC,MAAMC;IAKJ,MAAMC,QAAuB;QAC3B,MAAMC,SAAS,MAAMC,IAAAA,wBAAiB,EAAC;YACrCC,SAAS,IAAI,CAACC,gBAAgB,CAACC,IAAI,CAAC,IAAI;QAC1C;QAEA,IAAI,CAACC,SAAS,GAAGL,OAAOM,IAAI;QAC5B,IAAI,CAACC,WAAW,GAAGP;IACrB;IAEAQ,WAAiB;QACf,IAAI,IAAI,CAACD,WAAW,EAAE;YACpB,IAAI,CAACA,WAAW,CAACE,KAAK;YACtB,IAAI,CAACF,WAAW,GAAG;QACrB;IACF;IAEAG,YAAYC,MAAc,EAAQ;QAChC,IAAI,CAACC,aAAa,CAACC,MAAM,CAACF;IAC5B;IAEAT,QAAQS,MAAc,EAAEG,OAAqB,EAAQ;QACnD,IAAI,CAACF,aAAa,CAACG,GAAG,CAACJ,QAAQG;IACjC;IAEA,MAAcX,iBACZQ,MAAc,EACdK,OAAgB,EACa;QAC7B,MAAMF,UAAU,IAAI,CAACF,aAAa,CAACK,GAAG,CAACN;QACvC,OAAOG,2BAAAA,QAAUE;IACnB;;aAlCOX,YAAoB;aACnBE,cAAkC;aAClCK,gBAAgB,IAAIM;;AAiC9B;AAEO,eAAerB,uBACpBsB,GAAkD;IAElD,MAAMC,UAAU,IAAItB;IACpB,MAAMsB,QAAQrB,KAAK;IACnB,MAAMoB,IAAIC;IACVA,QAAQZ,QAAQ;AAClB"}
|
||||
3
node_modules/next/dist/experimental/testmode/playwright/page-route.d.ts
generated
vendored
Normal file
3
node_modules/next/dist/experimental/testmode/playwright/page-route.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import type { Page, Route } from '@playwright/test';
|
||||
import type { FetchHandler } from './next-worker-fixture';
|
||||
export declare function handleRoute(route: Route, page: Page, testHeaders: Record<string, string>, fetchHandler: FetchHandler | null): Promise<void>;
|
||||
59
node_modules/next/dist/experimental/testmode/playwright/page-route.js
generated
vendored
Normal file
59
node_modules/next/dist/experimental/testmode/playwright/page-route.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "handleRoute", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return handleRoute;
|
||||
}
|
||||
});
|
||||
function continueRoute(route, request, testHeaders) {
|
||||
return route.continue({
|
||||
headers: {
|
||||
...request.headers(),
|
||||
...testHeaders
|
||||
}
|
||||
});
|
||||
}
|
||||
async function handleRoute(route, page, testHeaders, fetchHandler) {
|
||||
const request = route.request();
|
||||
// Continue the navigation and non-fetch requests.
|
||||
if (request.isNavigationRequest() || request.resourceType() !== "fetch") {
|
||||
return continueRoute(route, request, testHeaders);
|
||||
}
|
||||
// Continue the local requests. The followup requests will be intercepted
|
||||
// on the server.
|
||||
const pageOrigin = new URL(page.url()).origin;
|
||||
const requestOrigin = new URL(request.url()).origin;
|
||||
if (pageOrigin === requestOrigin) {
|
||||
return continueRoute(route, request, testHeaders);
|
||||
}
|
||||
if (!fetchHandler) {
|
||||
return route.abort();
|
||||
}
|
||||
const postData = request.postDataBuffer();
|
||||
const fetchRequest = new Request(request.url(), {
|
||||
method: request.method(),
|
||||
headers: Object.fromEntries(Object.entries(request.headers()).filter(([name])=>!name.toLowerCase().startsWith("next-test-"))),
|
||||
body: postData ?? null
|
||||
});
|
||||
const proxyResponse = await fetchHandler(fetchRequest);
|
||||
if (!proxyResponse) {
|
||||
return route.abort();
|
||||
}
|
||||
if (proxyResponse === "abort") {
|
||||
return route.abort();
|
||||
}
|
||||
if (proxyResponse === "continue") {
|
||||
return continueRoute(route, request, testHeaders);
|
||||
}
|
||||
const { status, headers, body } = proxyResponse;
|
||||
return route.fulfill({
|
||||
status,
|
||||
headers: Object.fromEntries(headers),
|
||||
body: body ? Buffer.from(await proxyResponse.arrayBuffer()) : undefined
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=page-route.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/playwright/page-route.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/playwright/page-route.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/experimental/testmode/playwright/page-route.ts"],"names":["handleRoute","continueRoute","route","request","testHeaders","continue","headers","page","fetchHandler","isNavigationRequest","resourceType","pageOrigin","URL","url","origin","requestOrigin","abort","postData","postDataBuffer","fetchRequest","Request","method","Object","fromEntries","entries","filter","name","toLowerCase","startsWith","body","proxyResponse","status","fulfill","Buffer","from","arrayBuffer","undefined"],"mappings":";;;;+BAoBsBA;;;eAAAA;;;AAbtB,SAASC,cACPC,KAAY,EACZC,OAA0B,EAC1BC,WAAmC;IAEnC,OAAOF,MAAMG,QAAQ,CAAC;QACpBC,SAAS;YACP,GAAGH,QAAQG,OAAO,EAAE;YACpB,GAAGF,WAAW;QAChB;IACF;AACF;AAEO,eAAeJ,YACpBE,KAAY,EACZK,IAAU,EACVH,WAAmC,EACnCI,YAAiC;IAEjC,MAAML,UAAUD,MAAMC,OAAO;IAE7B,kDAAkD;IAClD,IAAIA,QAAQM,mBAAmB,MAAMN,QAAQO,YAAY,OAAO,SAAS;QACvE,OAAOT,cAAcC,OAAOC,SAASC;IACvC;IAEA,yEAAyE;IACzE,iBAAiB;IACjB,MAAMO,aAAa,IAAIC,IAAIL,KAAKM,GAAG,IAAIC,MAAM;IAC7C,MAAMC,gBAAgB,IAAIH,IAAIT,QAAQU,GAAG,IAAIC,MAAM;IACnD,IAAIH,eAAeI,eAAe;QAChC,OAAOd,cAAcC,OAAOC,SAASC;IACvC;IAEA,IAAI,CAACI,cAAc;QACjB,OAAON,MAAMc,KAAK;IACpB;IAEA,MAAMC,WAAWd,QAAQe,cAAc;IACvC,MAAMC,eAAe,IAAIC,QAAQjB,QAAQU,GAAG,IAAI;QAC9CQ,QAAQlB,QAAQkB,MAAM;QACtBf,SAASgB,OAAOC,WAAW,CACzBD,OAAOE,OAAO,CAACrB,QAAQG,OAAO,IAAImB,MAAM,CACtC,CAAC,CAACC,KAAK,GAAK,CAACA,KAAKC,WAAW,GAAGC,UAAU,CAAC;QAG/CC,MAAMZ,YAAY;IACpB;IAEA,MAAMa,gBAAgB,MAAMtB,aAAaW;IACzC,IAAI,CAACW,eAAe;QAClB,OAAO5B,MAAMc,KAAK;IACpB;IACA,IAAIc,kBAAkB,SAAS;QAC7B,OAAO5B,MAAMc,KAAK;IACpB;IACA,IAAIc,kBAAkB,YAAY;QAChC,OAAO7B,cAAcC,OAAOC,SAASC;IACvC;IACA,MAAM,EAAE2B,MAAM,EAAEzB,OAAO,EAAEuB,IAAI,EAAE,GAAGC;IAClC,OAAO5B,MAAM8B,OAAO,CAAC;QACnBD;QACAzB,SAASgB,OAAOC,WAAW,CAACjB;QAC5BuB,MAAMA,OAAOI,OAAOC,IAAI,CAAC,MAAMJ,cAAcK,WAAW,MAAMC;IAChE;AACF"}
|
||||
3
node_modules/next/dist/experimental/testmode/playwright/report.d.ts
generated
vendored
Normal file
3
node_modules/next/dist/experimental/testmode/playwright/report.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import type { TestInfo } from '@playwright/test';
|
||||
import type { FetchHandler } from './next-worker-fixture';
|
||||
export declare function reportFetch(testInfo: TestInfo, req: Request, handler: FetchHandler): Promise<Awaited<ReturnType<FetchHandler>>>;
|
||||
127
node_modules/next/dist/experimental/testmode/playwright/report.js
generated
vendored
Normal file
127
node_modules/next/dist/experimental/testmode/playwright/report.js
generated
vendored
Normal file
@ -0,0 +1,127 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "reportFetch", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return reportFetch;
|
||||
}
|
||||
});
|
||||
const _step = require("./step");
|
||||
async function parseBody(r) {
|
||||
const contentType = r.headers.get("content-type");
|
||||
let error;
|
||||
let text;
|
||||
let json;
|
||||
let formData;
|
||||
let buffer;
|
||||
if (contentType == null ? void 0 : contentType.includes("text")) {
|
||||
try {
|
||||
text = await r.text();
|
||||
} catch (e) {
|
||||
error = "failed to parse text";
|
||||
}
|
||||
} else if (contentType == null ? void 0 : contentType.includes("json")) {
|
||||
try {
|
||||
json = await r.json();
|
||||
} catch (e) {
|
||||
error = "failed to parse json";
|
||||
}
|
||||
} else if (contentType == null ? void 0 : contentType.includes("form-data")) {
|
||||
try {
|
||||
formData = await r.formData();
|
||||
} catch (e) {
|
||||
error = "failed to parse formData";
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
buffer = await r.arrayBuffer();
|
||||
} catch (e) {
|
||||
error = "failed to parse arrayBuffer";
|
||||
}
|
||||
}
|
||||
return {
|
||||
...error ? {
|
||||
error
|
||||
} : null,
|
||||
...text ? {
|
||||
text
|
||||
} : null,
|
||||
...json ? {
|
||||
json: JSON.stringify(json)
|
||||
} : null,
|
||||
...formData ? {
|
||||
formData: JSON.stringify(Array.from(formData))
|
||||
} : null,
|
||||
...buffer && buffer.byteLength > 0 ? {
|
||||
buffer: `base64;${Buffer.from(buffer).toString("base64")}`
|
||||
} : null
|
||||
};
|
||||
}
|
||||
function parseHeaders(headers) {
|
||||
return Object.fromEntries(Array.from(headers).sort(([key1], [key2])=>key1.localeCompare(key2)).map(([key, value])=>{
|
||||
return [
|
||||
`header.${key}`,
|
||||
value
|
||||
];
|
||||
}));
|
||||
}
|
||||
async function reportFetch(testInfo, req, handler) {
|
||||
return (0, _step.step)(testInfo, {
|
||||
title: `next.onFetch: ${req.method} ${req.url}`,
|
||||
category: "next.onFetch",
|
||||
apiName: "next.onFetch",
|
||||
params: {
|
||||
method: req.method,
|
||||
url: req.url,
|
||||
...await parseBody(req.clone()),
|
||||
...parseHeaders(req.headers)
|
||||
}
|
||||
}, async (complete)=>{
|
||||
const res = await handler(req);
|
||||
if (res === undefined || res == null) {
|
||||
complete({
|
||||
error: {
|
||||
message: "unhandled"
|
||||
}
|
||||
});
|
||||
} else if (typeof res === "string" && res !== "continue") {
|
||||
complete({
|
||||
error: {
|
||||
message: res
|
||||
}
|
||||
});
|
||||
} else {
|
||||
let body;
|
||||
if (typeof res === "string") {
|
||||
body = {
|
||||
response: res
|
||||
};
|
||||
} else {
|
||||
const { status, statusText } = res;
|
||||
body = {
|
||||
status,
|
||||
...statusText ? {
|
||||
statusText
|
||||
} : null,
|
||||
...await parseBody(res.clone()),
|
||||
...parseHeaders(res.headers)
|
||||
};
|
||||
}
|
||||
await (0, _step.step)(testInfo, {
|
||||
title: `next.onFetch.fulfilled: ${req.method} ${req.url}`,
|
||||
category: "next.onFetch",
|
||||
apiName: "next.onFetch.fulfilled",
|
||||
params: {
|
||||
...body,
|
||||
"request.url": req.url,
|
||||
"request.method": req.method
|
||||
}
|
||||
}, async ()=>undefined).catch(()=>undefined);
|
||||
}
|
||||
return res;
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=report.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/playwright/report.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/playwright/report.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/experimental/testmode/playwright/report.ts"],"names":["reportFetch","parseBody","r","contentType","headers","get","error","text","json","formData","buffer","includes","e","arrayBuffer","JSON","stringify","Array","from","byteLength","Buffer","toString","parseHeaders","Object","fromEntries","sort","key1","key2","localeCompare","map","key","value","testInfo","req","handler","step","title","method","url","category","apiName","params","clone","complete","res","undefined","message","body","response","status","statusText","catch"],"mappings":";;;;+BA2DsBA;;;eAAAA;;;sBAzDD;AAErB,eAAeC,UACbC,CAA0E;IAE1E,MAAMC,cAAcD,EAAEE,OAAO,CAACC,GAAG,CAAC;IAClC,IAAIC;IACJ,IAAIC;IACJ,IAAIC;IACJ,IAAIC;I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BAC9B;YACF,GACA,UAAYQ,WACZM,KAAK,CAAC,IAAMN;QAChB;QACA,OAAOD;IACT;AAEJ"}
|
||||
12
node_modules/next/dist/experimental/testmode/playwright/step.d.ts
generated
vendored
Normal file
12
node_modules/next/dist/experimental/testmode/playwright/step.d.ts
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import type { TestInfo } from '@playwright/test';
|
||||
export interface StepProps {
|
||||
category: string;
|
||||
title: string;
|
||||
apiName?: string;
|
||||
params?: Record<string, string | number | boolean | null | undefined>;
|
||||
}
|
||||
type Complete = (result: {
|
||||
error?: any;
|
||||
}) => void;
|
||||
export declare function step<T>(testInfo: TestInfo, props: StepProps, handler: (complete: Complete) => Promise<Awaited<T>>): Promise<Awaited<T>>;
|
||||
export {};
|
||||
40
node_modules/next/dist/experimental/testmode/playwright/step.js
generated
vendored
Normal file
40
node_modules/next/dist/experimental/testmode/playwright/step.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "step", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return step;
|
||||
}
|
||||
});
|
||||
const _test = require("@playwright/test");
|
||||
function isWithRunAsStep(testInfo) {
|
||||
return "_runAsStep" in testInfo;
|
||||
}
|
||||
async function step(testInfo, props, handler) {
|
||||
if (isWithRunAsStep(testInfo)) {
|
||||
return testInfo._runAsStep(props, ({ complete })=>handler(complete));
|
||||
}
|
||||
// Fallback to the `test.step()`.
|
||||
let result;
|
||||
let reportedError;
|
||||
try {
|
||||
console.log(props.title, props);
|
||||
await _test.test.step(props.title, async ()=>{
|
||||
result = await handler(({ error })=>{
|
||||
reportedError = error;
|
||||
if (reportedError) {
|
||||
throw reportedError;
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
if (error !== reportedError) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=step.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/playwright/step.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/playwright/step.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/experimental/testmode/playwright/step.ts"],"names":["step","isWithRunAsStep","testInfo","props","handler","_runAsStep","complete","result","reportedError","console","log","title","test","error"],"mappings":";;;;+BA4BsBA;;;eAAAA;;;sBA1BD;AAoBrB,SAASC,gBACPC,QAAkB;IAElB,OAAO,gBAAgBA;AACzB;AAEO,eAAeF,KACpBE,QAAkB,EAClBC,KAAgB,EAChBC,OAAoD;IAEpD,IAAIH,gBAAgBC,WAAW;QAC7B,OAAOA,SAASG,UAAU,CAACF,OAAO,CAAC,EAAEG,QAAQ,EAAE,GAAKF,QAAQE;IAC9D;IAEA,iCAAiC;IACjC,IAAIC;IACJ,IAAIC;IACJ,IAAI;QACFC,QAAQC,GAAG,CAACP,MAAMQ,KAAK,EAAER;QACzB,MAAMS,UAAI,CAACZ,IAAI,CAACG,MAAMQ,KAAK,EAAE;YAC3BJ,SAAS,MAAMH,QAAQ,CAAC,EAAES,KAAK,EAAE;gBAC/BL,gBAAgBK;gBAChB,IAAIL,eAAe;oBACjB,MAAMA;gBACR;YACF;QACF;IACF,EAAE,OAAOK,OAAO;QACd,IAAIA,UAAUL,eAAe;YAC3B,MAAMK;QACR;IACF;IACA,OAAON;AACT"}
|
||||
4
node_modules/next/dist/experimental/testmode/proxy/fetch-api.d.ts
generated
vendored
Normal file
4
node_modules/next/dist/experimental/testmode/proxy/fetch-api.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import type { ProxyFetchRequest, ProxyResponse } from './types';
|
||||
export type FetchHandlerResult = Response | 'abort' | 'continue' | null | undefined;
|
||||
export type FetchHandler = (testData: string, request: Request) => FetchHandlerResult | Promise<FetchHandlerResult>;
|
||||
export declare function handleFetch(req: ProxyFetchRequest, onFetch: FetchHandler): Promise<ProxyResponse>;
|
||||
48
node_modules/next/dist/experimental/testmode/proxy/fetch-api.js
generated
vendored
Normal file
48
node_modules/next/dist/experimental/testmode/proxy/fetch-api.js
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "handleFetch", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return handleFetch;
|
||||
}
|
||||
});
|
||||
const _types = require("./types");
|
||||
function buildRequest(req) {
|
||||
const { request: proxyRequest } = req;
|
||||
const { url, headers, body, ...options } = proxyRequest;
|
||||
return new Request(url, {
|
||||
...options,
|
||||
headers: new Headers(headers),
|
||||
body: body ? Buffer.from(body, "base64") : null
|
||||
});
|
||||
}
|
||||
async function buildResponse(response) {
|
||||
if (!response) {
|
||||
return _types.UNHANDLED;
|
||||
}
|
||||
if (response === "abort") {
|
||||
return _types.ABORT;
|
||||
}
|
||||
if (response === "continue") {
|
||||
return _types.CONTINUE;
|
||||
}
|
||||
const { status, headers, body } = response;
|
||||
return {
|
||||
api: "fetch",
|
||||
response: {
|
||||
status,
|
||||
headers: Array.from(headers),
|
||||
body: body ? Buffer.from(await response.arrayBuffer()).toString("base64") : null
|
||||
}
|
||||
};
|
||||
}
|
||||
async function handleFetch(req, onFetch) {
|
||||
const { testData } = req;
|
||||
const request = buildRequest(req);
|
||||
const response = await onFetch(testData, request);
|
||||
return buildResponse(response);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=fetch-api.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/proxy/fetch-api.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/proxy/fetch-api.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/experimental/testmode/proxy/fetch-api.ts"],"names":["handleFetch","buildRequest","req","request","proxyRequest","url","headers","body","options","Request","Headers","Buffer","from","buildResponse","response","UNHANDLED","ABORT","CONTINUE","status","api","Array","arrayBuffer","toString","onFetch","testData"],"mappings":";;;;+BAmDsBA;;;eAAAA;;;uBAlDqB;AAc3C,SAASC,aAAaC,GAAsB;IAC1C,MAAM,EAAEC,SAASC,YAAY,EAAE,GAAGF;IAClC,MAAM,EAAEG,GAAG,EAAEC,OAAO,EAAEC,IAAI,EAAE,GAAGC,SAAS,GAAGJ;IAC3C,OAAO,IAAIK,QAAQJ,KAAK;QACtB,GAAGG,OAAO;QACVF,SAAS,IAAII,QAAQJ;QACrBC,MAAMA,OAAOI,OAAOC,IAAI,CAACL,MAAM,YAAY;IAC7C;AACF;AAEA,eAAeM,cACbC,QAA4B;IAE5B,IAAI,CAACA,UAAU;QACb,OAAOC,gBAAS;IAClB;IACA,IAAID,aAAa,SAAS;QACxB,OAAOE,YAAK;IACd;IACA,IAAIF,aAAa,YAAY;QAC3B,OAAOG,eAAQ;IACjB;IAEA,MAAM,EAAEC,MAAM,EAAEZ,OAAO,EAAEC,IAAI,EAAE,GAAGO;IAClC,OAAO;QACLK,KAAK;QACLL,UAAU;YACRI;YACAZ,SAASc,MAAMR,IAAI,CAACN;YACpBC,MAAMA,OACFI,OAAOC,IAAI,CAAC,MAAME,SAASO,WAAW,IAAIC,QAAQ,CAAC,YACnD;QACN;IACF;AACF;AAEO,eAAetB,YACpBE,GAAsB,EACtBqB,OAAqB;IAErB,MAAM,EAAEC,QAAQ,EAAE,GAAGtB;IACrB,MAAMC,UAAUF,aAAaC;IAC7B,MAAMY,WAAW,MAAMS,QAAQC,UAAUrB;IACzC,OAAOU,cAAcC;AACvB"}
|
||||
3
node_modules/next/dist/experimental/testmode/proxy/index.d.ts
generated
vendored
Normal file
3
node_modules/next/dist/experimental/testmode/proxy/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
export { createProxyServer } from './server';
|
||||
export type { FetchHandler, FetchHandlerResult } from './fetch-api';
|
||||
export type * from './types';
|
||||
13
node_modules/next/dist/experimental/testmode/proxy/index.js
generated
vendored
Normal file
13
node_modules/next/dist/experimental/testmode/proxy/index.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "createProxyServer", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _server.createProxyServer;
|
||||
}
|
||||
});
|
||||
const _server = require("./server");
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/proxy/index.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/proxy/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/experimental/testmode/proxy/index.ts"],"names":["createProxyServer"],"mappings":";;;;+BAASA;;;eAAAA,yBAAiB;;;wBAAQ"}
|
||||
5
node_modules/next/dist/experimental/testmode/proxy/server.d.ts
generated
vendored
Normal file
5
node_modules/next/dist/experimental/testmode/proxy/server.d.ts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import type { ProxyServer } from './types';
|
||||
import type { FetchHandler } from './fetch-api';
|
||||
export declare function createProxyServer({ onFetch, }: {
|
||||
onFetch?: FetchHandler;
|
||||
}): Promise<ProxyServer>;
|
||||
85
node_modules/next/dist/experimental/testmode/proxy/server.js
generated
vendored
Normal file
85
node_modules/next/dist/experimental/testmode/proxy/server.js
generated
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "createProxyServer", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return createProxyServer;
|
||||
}
|
||||
});
|
||||
const _http = /*#__PURE__*/ _interop_require_default(require("http"));
|
||||
const _types = require("./types");
|
||||
const _fetchapi = require("./fetch-api");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
async function readBody(req) {
|
||||
const acc = [];
|
||||
for await (const chunk of req){
|
||||
acc.push(chunk);
|
||||
}
|
||||
return Buffer.concat(acc);
|
||||
}
|
||||
async function createProxyServer({ onFetch }) {
|
||||
const server = _http.default.createServer(async (req, res)=>{
|
||||
if (req.url !== "/") {
|
||||
res.writeHead(404);
|
||||
res.end();
|
||||
return;
|
||||
}
|
||||
let json;
|
||||
try {
|
||||
json = JSON.parse((await readBody(req)).toString("utf-8"));
|
||||
} catch (e) {
|
||||
res.writeHead(400);
|
||||
res.end();
|
||||
return;
|
||||
}
|
||||
const { api } = json;
|
||||
let response;
|
||||
switch(api){
|
||||
case "fetch":
|
||||
if (onFetch) {
|
||||
response = await (0, _fetchapi.handleFetch)(json, onFetch);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (!response) {
|
||||
response = _types.UNHANDLED;
|
||||
}
|
||||
res.writeHead(200, {
|
||||
"Content-Type": "application/json"
|
||||
});
|
||||
res.write(JSON.stringify(response));
|
||||
res.end();
|
||||
});
|
||||
await new Promise((resolve)=>{
|
||||
server.listen(0, "localhost", ()=>{
|
||||
resolve(undefined);
|
||||
});
|
||||
});
|
||||
const address = server.address();
|
||||
if (!address || typeof address !== "object") {
|
||||
server.close();
|
||||
throw new Error("Failed to create a proxy server");
|
||||
}
|
||||
const port = address.port;
|
||||
const fetchWith = (input, init, testData)=>{
|
||||
const request = new Request(input, init);
|
||||
request.headers.set("Next-Test-Proxy-Port", String(port));
|
||||
request.headers.set("Next-Test-Data", testData ?? "");
|
||||
return fetch(request);
|
||||
};
|
||||
return {
|
||||
port,
|
||||
close: ()=>server.close(),
|
||||
fetchWith
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=server.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/proxy/server.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/proxy/server.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/experimental/testmode/proxy/server.ts"],"names":["createProxyServer","readBody","req","acc","chunk","push","Buffer","concat","onFetch","server","http","createServer","res","url","writeHead","end","json","JSON","parse","toString","e","api","response","handleFetch","UNHANDLED","write","stringify","Promise","resolve","listen","undefined","address","close","Error","port","fetchWith","input","init","testData","request","Request","headers","set","String","fetch"],"mappings":";;;;+BAiBsBA;;;eAAAA;;;6DAjBL;uBAGS;0BAEE;;;;;;AAE5B,eAAeC,SAASC,GAAoB;IAC1C,MAAMC,MAAgB,EAAE;IAExB,WAAW,MAAMC,SAASF,IAAK;QAC7BC,IAAIE,IAAI,CAACD;IACX;IAEA,OAAOE,OAAOC,MAAM,CAACJ;AACvB;AAEO,eAAeH,kBAAkB,EACtCQ,OAAO,EAGR;IACC,MAAMC,SAASC,aAAI,CAACC,YAAY,CAAC,OAAOT,KAAKU;QAC3C,IAAIV,IAAIW,GAAG,KAAK,KAAK;YACnBD,IAAIE,SAAS,CAAC;YACdF,IAAIG,GAAG;YACP;QACF;QAEA,IAAIC;QACJ,IAAI;YACFA,OAAOC,KAAKC,KAAK,CAAC,AAAC,CAAA,MAAMjB,SAASC,IAAG,EAAGiB,QAAQ,CAAC;QACnD,EAAE,OAAOC,GAAG;YACVR,IAAIE,SAAS,CAAC;YACdF,IAAIG,GAAG;YACP;QACF;QAEA,MAAM,EAAEM,GAAG,EAAE,GAAGL;QAEhB,IAAIM;QACJ,OAAQD;YACN,KAAK;gBACH,IAAIb,SAAS;oBACXc,WAAW,MAAMC,IAAAA,qBAAW,EAACP,MAAMR;gBACrC;gBACA;YACF;gBACE;QACJ;QACA,IAAI,CAACc,UAAU;YACbA,WAAWE,gBAAS;QACtB;QAEAZ,IAAIE,SAAS,CAAC,KAAK;YAAE,gBAAgB;QAAmB;QACxDF,IAAIa,KAAK,CAACR,KAAKS,SAAS,CAACJ;QACzBV,IAAIG,GAAG;IACT;IAEA,MAAM,IAAIY,QAAQ,CAACC;QACjBnB,OAAOoB,MAAM,CAAC,GAAG,aAAa;YAC5BD,QAAQE;QACV;IACF;IAEA,MAAMC,UAAUtB,OAAOsB,OAAO;IAC9B,IAAI,CAACA,WAAW,OAAOA,YAAY,UAAU;QAC3CtB,OAAOuB,KAAK;QACZ,MAAM,IAAIC,MAAM;IAClB;IACA,MAAMC,OAAOH,QAAQG,IAAI;IAEzB,MAAMC,YAAsC,CAACC,OAAOC,MAAMC;QACxD,MAAMC,UAAU,IAAIC,QAAQJ,OAAOC;QACnCE,QAAQE,OAAO,CAACC,GAAG,CAAC,wBAAwBC,OAAOT;QACnDK,QAAQE,OAAO,CAACC,GAAG,CAAC,kBAAkBJ,YAAY;QAClD,OAAOM,MAAML;IACf;IAEA,OAAO;QAAEL;QAAMF,OAAO,IAAMvB,OAAOuB,KAAK;QAAIG;IAAU;AACxD"}
|
||||
43
node_modules/next/dist/experimental/testmode/proxy/types.d.ts
generated
vendored
Normal file
43
node_modules/next/dist/experimental/testmode/proxy/types.d.ts
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
export interface ProxyServer {
|
||||
readonly port: number;
|
||||
fetchWith(input: string | URL, init?: RequestInit, testData?: string): Promise<Response>;
|
||||
close(): void;
|
||||
}
|
||||
interface ProxyRequestBase {
|
||||
testData: string;
|
||||
api: string;
|
||||
}
|
||||
interface ProxyResponseBase {
|
||||
api: string;
|
||||
}
|
||||
export interface ProxyUnhandledResponse extends ProxyResponseBase {
|
||||
api: 'unhandled';
|
||||
}
|
||||
export interface ProxyAbortResponse extends ProxyResponseBase {
|
||||
api: 'abort';
|
||||
}
|
||||
export interface ProxyContinueResponse extends ProxyResponseBase {
|
||||
api: 'continue';
|
||||
}
|
||||
export interface ProxyFetchRequest extends ProxyRequestBase {
|
||||
api: 'fetch';
|
||||
request: {
|
||||
url: string;
|
||||
headers: Array<[string, string]>;
|
||||
body: string | null;
|
||||
} & Omit<RequestInit, 'headers' | 'body'>;
|
||||
}
|
||||
export interface ProxyFetchResponse extends ProxyResponseBase {
|
||||
api: 'fetch';
|
||||
response: {
|
||||
status: number;
|
||||
headers: Array<[string, string]>;
|
||||
body: string | null;
|
||||
};
|
||||
}
|
||||
export type ProxyRequest = ProxyFetchRequest;
|
||||
export type ProxyResponse = ProxyUnhandledResponse | ProxyAbortResponse | ProxyContinueResponse | ProxyFetchResponse;
|
||||
export declare const ABORT: ProxyResponse;
|
||||
export declare const CONTINUE: ProxyResponse;
|
||||
export declare const UNHANDLED: ProxyResponse;
|
||||
export {};
|
||||
37
node_modules/next/dist/experimental/testmode/proxy/types.js
generated
vendored
Normal file
37
node_modules/next/dist/experimental/testmode/proxy/types.js
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
ABORT: null,
|
||||
CONTINUE: null,
|
||||
UNHANDLED: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
ABORT: function() {
|
||||
return ABORT;
|
||||
},
|
||||
CONTINUE: function() {
|
||||
return CONTINUE;
|
||||
},
|
||||
UNHANDLED: function() {
|
||||
return UNHANDLED;
|
||||
}
|
||||
});
|
||||
const ABORT = {
|
||||
api: "abort"
|
||||
};
|
||||
const CONTINUE = {
|
||||
api: "continue"
|
||||
};
|
||||
const UNHANDLED = {
|
||||
api: "unhandled"
|
||||
};
|
||||
|
||||
//# sourceMappingURL=types.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/proxy/types.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/proxy/types.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/experimental/testmode/proxy/types.ts"],"names":["ABORT","CONTINUE","UNHANDLED","api"],"mappings":";;;;;;;;;;;;;;;;IAyDaA,KAAK;eAALA;;IACAC,QAAQ;eAARA;;IACAC,SAAS;eAATA;;;AAFN,MAAMF,QAAuB;IAAEG,KAAK;AAAQ;AAC5C,MAAMF,WAA0B;IAAEE,KAAK;AAAW;AAClD,MAAMD,YAA2B;IAAEC,KAAK;AAAY"}
|
||||
2
node_modules/next/dist/experimental/testmode/server-edge.d.ts
generated
vendored
Normal file
2
node_modules/next/dist/experimental/testmode/server-edge.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export declare function interceptTestApis(): () => void;
|
||||
export declare function wrapRequestHandler<T>(handler: (req: Request, fn: () => T) => T): (req: Request, fn: () => T) => T;
|
||||
32
node_modules/next/dist/experimental/testmode/server-edge.js
generated
vendored
Normal file
32
node_modules/next/dist/experimental/testmode/server-edge.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
interceptTestApis: null,
|
||||
wrapRequestHandler: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
interceptTestApis: function() {
|
||||
return interceptTestApis;
|
||||
},
|
||||
wrapRequestHandler: function() {
|
||||
return wrapRequestHandler;
|
||||
}
|
||||
});
|
||||
const _context = require("./context");
|
||||
const _fetch = require("./fetch");
|
||||
function interceptTestApis() {
|
||||
return (0, _fetch.interceptFetch)(global.fetch);
|
||||
}
|
||||
function wrapRequestHandler(handler) {
|
||||
return (req, fn)=>(0, _context.withRequest)(req, _fetch.reader, ()=>handler(req, fn));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=server-edge.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/server-edge.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/server-edge.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/experimental/testmode/server-edge.ts"],"names":["interceptTestApis","wrapRequestHandler","interceptFetch","global","fetch","handler","req","fn","withRequestContext","reader"],"mappings":";;;;;;;;;;;;;;;IAGgBA,iBAAiB;eAAjBA;;IAIAC,kBAAkB;eAAlBA;;;yBAPkC;uBACX;AAEhC,SAASD;IACd,OAAOE,IAAAA,qBAAc,EAACC,OAAOC,KAAK;AACpC;AAEO,SAASH,mBACdI,OAAyC;IAEzC,OAAO,CAACC,KAAKC,KAAOC,IAAAA,oBAAkB,EAACF,KAAKG,aAAM,EAAE,IAAMJ,QAAQC,KAAKC;AACzE"}
|
||||
5
node_modules/next/dist/experimental/testmode/server.d.ts
generated
vendored
Normal file
5
node_modules/next/dist/experimental/testmode/server.d.ts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import type { WorkerRequestHandler } from '../../server/lib/types';
|
||||
import type { NodeRequestHandler } from '../../server/next-server';
|
||||
export declare function interceptTestApis(): () => void;
|
||||
export declare function wrapRequestHandlerWorker(handler: WorkerRequestHandler): WorkerRequestHandler;
|
||||
export declare function wrapRequestHandlerNode(handler: NodeRequestHandler): NodeRequestHandler;
|
||||
62
node_modules/next/dist/experimental/testmode/server.js
generated
vendored
Normal file
62
node_modules/next/dist/experimental/testmode/server.js
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
interceptTestApis: null,
|
||||
wrapRequestHandlerNode: null,
|
||||
wrapRequestHandlerWorker: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
interceptTestApis: function() {
|
||||
return interceptTestApis;
|
||||
},
|
||||
wrapRequestHandlerNode: function() {
|
||||
return wrapRequestHandlerNode;
|
||||
},
|
||||
wrapRequestHandlerWorker: function() {
|
||||
return wrapRequestHandlerWorker;
|
||||
}
|
||||
});
|
||||
const _context = require("./context");
|
||||
const _fetch = require("./fetch");
|
||||
const _httpget = require("./httpget");
|
||||
const reader = {
|
||||
url (req) {
|
||||
return req.url ?? "";
|
||||
},
|
||||
header (req, name) {
|
||||
const h = req.headers[name];
|
||||
if (h === undefined || h === null) {
|
||||
return null;
|
||||
}
|
||||
if (typeof h === "string") {
|
||||
return h;
|
||||
}
|
||||
return h[0] ?? null;
|
||||
}
|
||||
};
|
||||
function interceptTestApis() {
|
||||
const originalFetch = global.fetch;
|
||||
const restoreFetch = (0, _fetch.interceptFetch)(originalFetch);
|
||||
const restoreHttpGet = (0, _httpget.interceptHttpGet)(originalFetch);
|
||||
// Cleanup.
|
||||
return ()=>{
|
||||
restoreFetch();
|
||||
restoreHttpGet();
|
||||
};
|
||||
}
|
||||
function wrapRequestHandlerWorker(handler) {
|
||||
return (req, res)=>(0, _context.withRequest)(req, reader, ()=>handler(req, res));
|
||||
}
|
||||
function wrapRequestHandlerNode(handler) {
|
||||
return (req, res, parsedUrl)=>(0, _context.withRequest)(req, reader, ()=>handler(req, res, parsedUrl));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=server.js.map
|
||||
1
node_modules/next/dist/experimental/testmode/server.js.map
generated
vendored
Normal file
1
node_modules/next/dist/experimental/testmode/server.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/experimental/testmode/server.ts"],"names":["interceptTestApis","wrapRequestHandlerNode","wrapRequestHandlerWorker","reader","url","req","header","name","h","headers","undefined","originalFetch","global","fetch","restoreFetch","interceptFetch","restoreHttpGet","interceptHttpGet","handler","res","withRequest","parsedUrl"],"mappings":";;;;;;;;;;;;;;;;IAuBgBA,iBAAiB;eAAjBA;;IAkBAC,sBAAsB;eAAtBA;;IANAC,wBAAwB;eAAxBA;;;yBAjCoC;uBACrB;yBACE;AAGjC,MAAMC,SAA6C;IACjDC,KAAIC,GAAG;QACL,OAAOA,IAAID,GAAG,IAAI;IACpB;IACAE,QAAOD,GAAG,EAAEE,IAAI;QACd,MAAMC,IAAIH,IAAII,OAAO,CAACF,KAAK;QAC3B,IAAIC,MAAME,aAAaF,MAAM,MAAM;YACjC,OAAO;QACT;QACA,IAAI,OAAOA,MAAM,UAAU;YACzB,OAAOA;QACT;QACA,OAAOA,CAAC,CAAC,EAAE,IAAI;IACjB;AACF;AAEO,SAASR;IACd,MAAMW,gBAAgBC,OAAOC,KAAK;IAClC,MAAMC,eAAeC,IAAAA,qBAAc,EAACJ;IACpC,MAAMK,iBAAiBC,IAAAA,yBAAgB,EAACN;IAExC,WAAW;IACX,OAAO;QACLG;QACAE;IACF;AACF;AAEO,SAASd,yBACdgB,OAA6B;IAE7B,OAAO,CAACb,KAAKc,MAAQC,IAAAA,oBAAW,EAACf,KAAKF,QAAQ,IAAMe,QAAQb,KAAKc;AACnE;AAEO,SAASlB,uBACdiB,OAA2B;IAE3B,OAAO,CAACb,KAAKc,KAAKE,YAChBD,IAAAA,oBAAW,EAACf,KAAKF,QAAQ,IAAMe,QAAQb,KAAKc,KAAKE;AACrD"}
|
||||
Reference in New Issue
Block a user