config-mode.test.js — astro Source File
Architecture documentation for config-mode.test.js, a javascript file in the astro codebase. 5 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR f3ce271d_84e1_17af_eed2_fb5579e063e7["config-mode.test.js"] be670a78_841c_46e5_0af5_c5c328869ecb["test-adapter.js"] f3ce271d_84e1_17af_eed2_fb5579e063e7 --> be670a78_841c_46e5_0af5_c5c328869ecb 0a624eac_945e_c9e8_c9de_3feb9de2dd15["test-utils.js"] f3ce271d_84e1_17af_eed2_fb5579e063e7 --> 0a624eac_945e_c9e8_c9de_3feb9de2dd15 dd4f09ce_3fd7_8295_f616_8876cda4555c["loadFixture"] f3ce271d_84e1_17af_eed2_fb5579e063e7 --> dd4f09ce_3fd7_8295_f616_8876cda4555c e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"] f3ce271d_84e1_17af_eed2_fb5579e063e7 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607 6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"] f3ce271d_84e1_17af_eed2_fb5579e063e7 --> 6b0635f9_51ea_77aa_767b_7857878e98a6 style f3ce271d_84e1_17af_eed2_fb5579e063e7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import testAdapter from './test-adapter.js';
import { loadFixture } from './test-utils.js';
describe('AstroConfig - config.output', () => {
describe(`output: 'server'`, () => {
describe('deploy config provided', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
before(async () => {
fixture = await loadFixture({
// This is just a random fixture to test, doesn't matter.
root: './fixtures/astro-basic/',
adapter: testAdapter(),
output: 'server',
});
await fixture.build();
});
it('Builds an SSR-able app', async () => {
const app = await fixture.loadTestAdapterApp();
const request = new Request('http://example.com/');
const response = await app.render(request);
assert.equal(response.status, 200);
assert.equal(response.headers.get('content-type'), 'text/html');
const html = await response.text();
assert.equal(html.length > 0, true);
});
});
describe('deploy config omitted', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
before(async () => {
fixture = await loadFixture({
// This is just a random fixture to test, doesn't matter.
root: './fixtures/astro-basic/',
output: 'server',
});
});
it('Throws during the build', async () => {
let built = false;
try {
await fixture.build();
built = true;
} catch (err) {
assert.equal(err instanceof Error, true);
assert.match(err.message, /without an adapter/);
}
assert.equal(built, false, 'Should not have built');
});
});
});
describe(`output: 'static'`, () => {
describe('Output config omitted', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
before(async () => {
fixture = await loadFixture({
// This is just a random fixture to test, doesn't matter.
root: './fixtures/astro-basic/',
output: 'static',
});
await fixture.build();
});
it('Builds to static HTML', async () => {
let html;
try {
html = await fixture.readFile('/index.html');
} catch {
assert.equal(false, true, 'Couldnt find the file, which mean it did not build.');
}
assert.equal(html.length > 0, true);
});
});
describe.skip('deploy config provided - TODO, we need adapters to support static mode first', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
before(async () => {
fixture = await loadFixture({
// This is just a random fixture to test, doesn't matter.
root: './fixtures/astro-basic/',
adapter: testAdapter(),
output: 'server',
});
await fixture.build();
});
});
});
});
Domain
Dependencies
- loadFixture
- node:test
- strict
- test-adapter.js
- test-utils.js
Source
Frequently Asked Questions
What does config-mode.test.js do?
config-mode.test.js is a source file in the astro codebase, written in javascript. It belongs to the IntegrationAdapters domain.
What does config-mode.test.js depend on?
config-mode.test.js imports 5 module(s): loadFixture, node:test, strict, test-adapter.js, test-utils.js.
Where is config-mode.test.js in the architecture?
config-mode.test.js is located at packages/astro/test/config-mode.test.js (domain: IntegrationAdapters, directory: packages/astro/test).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free