heartbeat-monitor/node_modules/next/dist/experimental/testing/server/config-testing-utils.d.ts
Matt Bruce bed1169443 Initial commit: Heartbeat Monitor dashboard
- Full-featured monitoring dashboard for local web apps
- Real-time status tracking with uptime percentages
- Visual sparklines for status history
- Add/Edit/Delete apps dynamically
- Categories and color coding
- Auto-refresh every 30 seconds
- API endpoints for apps and status management
2026-02-18 11:16:01 -06:00

32 lines
1.2 KiB
TypeScript

import type { IncomingHttpHeaders } from 'node:http';
import type { NextConfig } from '../../../server/config-shared';
import { NextResponse } from '../../../server/web/exports';
/**
* Tests the logic of `headers`, `redirects`, and `rewrites` in `next.config.js`.
* Given the provided next config, this function will return a `NextResponse`
* with the result of running the request through the custom routes.
*
* @example Test whether a given URL results in a redirect.
* ```
* import { unstable_getResponseFromNextConfig, getRedirectUrl } from 'next/server/testing'
* const response = await unstable_getResponseFromNextConfig({
* url: 'https://nextjs.org/test',
* nextConfig: {
* async redirects() {
* return [
* { source: '/test', destination: '/test2', permanent: false },
* ]
* },
* }
* });
* expect(response.status).toEqual(307);
* expect(getRedirectUrl(response)).toEqual('https://nextjs.org/test2');
* ```
*/
export declare function unstable_getResponseFromNextConfig({ url, nextConfig, headers, cookies, }: {
url: string;
nextConfig: NextConfig;
headers?: IncomingHttpHeaders;
cookies?: Record<string, string>;
}): Promise<NextResponse>;