Home / Function/ commonExpectations() — astro Function Reference

commonExpectations() — astro Function Reference

Architecture documentation for the commonExpectations() function in css-inline-stylesheets.test.js from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  f5bb66c4_5933_bafa_56c6_58e7e543203f["commonExpectations()"]
  69f44a61_9817_7df2_a252_265cbb82c7d7["css-inline-stylesheets.test.js"]
  f5bb66c4_5933_bafa_56c6_58e7e543203f -->|defined in| 69f44a61_9817_7df2_a252_265cbb82c7d7
  style f5bb66c4_5933_bafa_56c6_58e7e543203f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/test/css-inline-stylesheets.test.js lines 296–315

function commonExpectations(allStyles) {
	it('Includes all authored css', () => {
		// authored in imported.css
		assert.ok(allStyles.value.includes('.bg-lightcoral'));

		// authored in index.astro
		assert.ok(allStyles.value.includes('#welcome'));

		// authored in components/Button.astro
		assert.ok(allStyles.value.includes('.variant-outline'));

		// authored in layouts/Layout.astro
		assert.ok(allStyles.value.includes('Menlo'));
	});

	it('Styles used both in content layout and directly in page are included only once', () => {
		// authored in components/Button.astro
		assert.equal(allStyles.value.match(/cubic-bezier/g).length, 1);
	});
}

Subdomains

Frequently Asked Questions

What does commonExpectations() do?
commonExpectations() is a function in the astro codebase, defined in packages/astro/test/css-inline-stylesheets.test.js.
Where is commonExpectations() defined?
commonExpectations() is defined in packages/astro/test/css-inline-stylesheets.test.js at line 296.

Analyze Your Own Codebase

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

Try Supermodel Free