Home / File/ test-adapter.js — astro Source File

test-adapter.js — astro Source File

Architecture documentation for test-adapter.js, a javascript file in the astro codebase. 1 imports, 76 dependents.

File javascript IntegrationAdapters SsrAdapters 1 imports 76 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  be670a78_841c_46e5_0af5_c5c328869ecb["test-adapter.js"]
  45d75631_8144_95ec_f884_4b5cbaefa0c5["../dist/core/util.js"]
  be670a78_841c_46e5_0af5_c5c328869ecb --> 45d75631_8144_95ec_f884_4b5cbaefa0c5
  0f73a651_d35e_b6e6_5487_2bad4a73cff5["custom-client-directives.test.js"]
  0f73a651_d35e_b6e6_5487_2bad4a73cff5 --> be670a78_841c_46e5_0af5_c5c328869ecb
  9dc246d5_3c0e_e5e2_ef27_d14871c178d5["actions.test.js"]
  9dc246d5_3c0e_e5e2_ef27_d14871c178d5 --> be670a78_841c_46e5_0af5_c5c328869ecb
  03aa48a8_8ce4_1143_b5e9_01f63d05f7bb["asset-query-params.test.js"]
  03aa48a8_8ce4_1143_b5e9_01f63d05f7bb --> be670a78_841c_46e5_0af5_c5c328869ecb
  ee56b650_a538_6287_413f_0137a9a4f896["astro-assets-prefix-multi-cdn.test.js"]
  ee56b650_a538_6287_413f_0137a9a4f896 --> be670a78_841c_46e5_0af5_c5c328869ecb
  65016ab9_b5f8_83ba_c1a0_fe950249c16f["astro-assets-prefix.test.js"]
  65016ab9_b5f8_83ba_c1a0_fe950249c16f --> be670a78_841c_46e5_0af5_c5c328869ecb
  6f37c942_24c9_a684_d958_038391637d35["astro-cookies.test.js"]
  6f37c942_24c9_a684_d958_038391637d35 --> be670a78_841c_46e5_0af5_c5c328869ecb
  94cd6b03_0f48_e8aa_36cf_d918c8164787["astro-envs.test.js"]
  94cd6b03_0f48_e8aa_36cf_d918c8164787 --> be670a78_841c_46e5_0af5_c5c328869ecb
  bb064f8e_0ca7_d9db_79bb_fb1ae93aaad5["astro-global.test.js"]
  bb064f8e_0ca7_d9db_79bb_fb1ae93aaad5 --> be670a78_841c_46e5_0af5_c5c328869ecb
  4a99aff7_bb59_0dca_4e85_5d236a82edc5["before-hydration.test.js"]
  4a99aff7_bb59_0dca_4e85_5d236a82edc5 --> be670a78_841c_46e5_0af5_c5c328869ecb
  ab7bced8_58a8_d751_aa84_deea065539d8["build-assets.test.js"]
  ab7bced8_58a8_d751_aa84_deea065539d8 --> be670a78_841c_46e5_0af5_c5c328869ecb
  f5f390bf_a302_d0aa_76a7_96e703f46931["build-readonly-file.test.js"]
  f5f390bf_a302_d0aa_76a7_96e703f46931 --> be670a78_841c_46e5_0af5_c5c328869ecb
  70ed68a2_245b_aeb2_2b68_39ca3a3f85ca["client-address.test.js"]
  70ed68a2_245b_aeb2_2b68_39ca3a3f85ca --> be670a78_841c_46e5_0af5_c5c328869ecb
  f3ce271d_84e1_17af_eed2_fb5579e063e7["config-mode.test.js"]
  f3ce271d_84e1_17af_eed2_fb5579e063e7 --> be670a78_841c_46e5_0af5_c5c328869ecb
  style be670a78_841c_46e5_0af5_c5c328869ecb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { viteID } from '../dist/core/util.js';

/**
 * @typedef {import('../src/types/public/integrations.js').AstroAdapter} AstroAdapter
 * @typedef {import('../src/types/public/integrations.js').AstroIntegration} AstroIntegration
 * @typedef {import('../src/types/public/integrations.js').HookParameters<"astro:build:ssr">['middlewareEntryPoint']} MiddlewareEntryPoint
 * @typedef {import('../src/types/public/integrations.js').HookParameters<"astro:build:done">['routes']} Routes
 */

/**
 *
 * @param {{
 * 	provideAddress?: boolean;
 * 	extendAdapter?: AstroAdapter;
 * 	setMiddlewareEntryPoint?: (middlewareEntryPoint: MiddlewareEntryPoint) => void;
 * 	env: Record<string, string | undefined>;
 * }} param0
 * @returns {AstroIntegration}
 */
export default function ({
	provideAddress = true,
	staticHeaders = false,
	extendAdapter,
	setMiddlewareEntryPoint,
	setManifest,
	setRouteToHeaders,
	env,
} = {}) {
	return {
		name: 'my-ssr-adapter',
		hooks: {
			'astro:config:setup': ({ updateConfig }) => {
				updateConfig({
					vite: {
						plugins: [
							{
								resolveId: {
									filter: {
										id: /^(astro\/app|@my-ssr)$/,
									},
									handler(id) {
										if (id === '@my-ssr') {
											return id;
										}
										return viteID(new URL('../dist/core/app/index.js', import.meta.url));
									},
								},
								load: {
									filter: {
										id: /^@my-ssr$/,
									},
									handler() {
										return {
											code: `
											import { App, AppPipeline } from 'astro/app';
											import fs from 'fs';

											${
												env
													? `
// ... (234 more lines)

Subdomains

Functions

Dependencies

  • ../dist/core/util.js

Imported By

Frequently Asked Questions

What does test-adapter.js do?
test-adapter.js is a source file in the astro codebase, written in javascript. It belongs to the IntegrationAdapters domain, SsrAdapters subdomain.
What functions are defined in test-adapter.js?
test-adapter.js defines 1 function(s): selfTestAdapter.
What does test-adapter.js depend on?
test-adapter.js imports 1 module(s): ../dist/core/util.js.
What files import test-adapter.js?
test-adapter.js is imported by 76 file(s): actions.test.js, asset-query-params.test.js, astro-assets-prefix-multi-cdn.test.js, astro-assets-prefix.test.js, astro-cookies.test.js, astro-envs.test.js, astro-global.test.js, astro.config.mjs, and 68 more.
Where is test-adapter.js in the architecture?
test-adapter.js is located at packages/astro/test/test-adapter.js (domain: IntegrationAdapters, subdomain: SsrAdapters, directory: packages/astro/test).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free