Home / File/ css-inline-stylesheets.test.js — astro Source File

css-inline-stylesheets.test.js — astro Source File

Architecture documentation for css-inline-stylesheets.test.js, a javascript file in the astro codebase. 6 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  69f44a61_9817_7df2_a252_265cbb82c7d7["css-inline-stylesheets.test.js"]
  be670a78_841c_46e5_0af5_c5c328869ecb["test-adapter.js"]
  69f44a61_9817_7df2_a252_265cbb82c7d7 --> be670a78_841c_46e5_0af5_c5c328869ecb
  0a624eac_945e_c9e8_c9de_3feb9de2dd15["test-utils.js"]
  69f44a61_9817_7df2_a252_265cbb82c7d7 --> 0a624eac_945e_c9e8_c9de_3feb9de2dd15
  dd4f09ce_3fd7_8295_f616_8876cda4555c["loadFixture"]
  69f44a61_9817_7df2_a252_265cbb82c7d7 --> dd4f09ce_3fd7_8295_f616_8876cda4555c
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  69f44a61_9817_7df2_a252_265cbb82c7d7 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  69f44a61_9817_7df2_a252_265cbb82c7d7 --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  deb87372_5629_35f8_9a54_e755a08f776a["cheerio"]
  69f44a61_9817_7df2_a252_265cbb82c7d7 --> deb87372_5629_35f8_9a54_e755a08f776a
  style 69f44a61_9817_7df2_a252_265cbb82c7d7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import testAdapter from './test-adapter.js';
import { loadFixture } from './test-utils.js';

describe('Setting inlineStylesheets to never in static output', () => {
	let fixture;

	before(async () => {
		fixture = await loadFixture({
			// inconsequential config that differs between tests
			// to bust cache and prevent modules and their state
			// from being reused
			site: 'https://test.dev/',
			root: './fixtures/css-inline-stylesheets/',
			output: 'static',
			outDir: './dist/static-inline-stylesheets-never',
			build: {
				inlineStylesheets: 'never',
			},
		});
		await fixture.build();
	});

	it('Does not render any <style> tags', async () => {
		const html = await fixture.readFile('/index.html');
		const $ = cheerio.load(html);

		assert.equal($('style').toArray().length, 0);
	});

	describe('Inspect linked stylesheets', () => {
		// object, so it can be passed by reference
		const allStyles = {};

		before(async () => {
			allStyles.value = await stylesFromStaticOutput(fixture);
		});

		commonExpectations(allStyles);
	});
});

describe('Setting inlineStylesheets to never in server output', () => {
	let app;

	before(async () => {
		const fixture = await loadFixture({
			// inconsequential config that differs between tests
			// to bust cache and prevent modules and their state
			// from being reused
			site: 'https://test.dev/',
			root: './fixtures/css-inline-stylesheets/',
			output: 'server',
			adapter: testAdapter(),
			outDir: './dist/server-inline-stylesheets-never',
			build: {
				inlineStylesheets: 'never',
			},
// ... (256 more lines)

Subdomains

Dependencies

Frequently Asked Questions

What does css-inline-stylesheets.test.js do?
css-inline-stylesheets.test.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 css-inline-stylesheets.test.js?
css-inline-stylesheets.test.js defines 3 function(s): commonExpectations, stylesFromServer, stylesFromStaticOutput.
What does css-inline-stylesheets.test.js depend on?
css-inline-stylesheets.test.js imports 6 module(s): cheerio, loadFixture, node:test, strict, test-adapter.js, test-utils.js.
Where is css-inline-stylesheets.test.js in the architecture?
css-inline-stylesheets.test.js is located at packages/astro/test/css-inline-stylesheets.test.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