Home / File/ cloudflare.test.js — astro Source File

cloudflare.test.js — astro Source File

Architecture documentation for cloudflare.test.js, a javascript file in the astro codebase. 4 imports, 0 dependents.

File javascript E2ETesting TestFixtures 4 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  f09edeb5_2bf0_094d_f488_7fc8b4becf8f["cloudflare.test.js"]
  2ca394f6_a63d_3921_1f12_c5a979ea0039["test-utils.js"]
  f09edeb5_2bf0_094d_f488_7fc8b4becf8f --> 2ca394f6_a63d_3921_1f12_c5a979ea0039
  e27f6887_ea47_dd44_7933_5faa0f6bcf4d["testFactory"]
  f09edeb5_2bf0_094d_f488_7fc8b4becf8f --> e27f6887_ea47_dd44_7933_5faa0f6bcf4d
  fd78a73b_736e_fadc_4cb6_d558754a9939["createLoggerSpy"]
  f09edeb5_2bf0_094d_f488_7fc8b4becf8f --> fd78a73b_736e_fadc_4cb6_d558754a9939
  f8fbe851_c5d6_c4ee_c044_67a751668c18["test"]
  f09edeb5_2bf0_094d_f488_7fc8b4becf8f --> f8fbe851_c5d6_c4ee_c044_67a751668c18
  style f09edeb5_2bf0_094d_f488_7fc8b4becf8f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { expect } from '@playwright/test';
import { testFactory, createLoggerSpy } from './test-utils.js';

const test = testFactory(import.meta.url, {
	root: './fixtures/cloudflare/',
	devToolbar: {
		enabled: false,
	},
});

function sharedTests(testRunner, infoLogs = null) {
	testRunner('renders SSR index page', async ({ page, astro }) => {
		await page.goto(astro.resolveUrl('/'));
		const h1 = page.locator('#blog-posts');
		await expect(h1).toContainText('Blog Posts');
	});

	testRunner('content collections - getCollection()', async ({ page, astro }) => {
		await page.goto(astro.resolveUrl('/'));
		const dogsList = page.locator('#dogs-list');
		await expect(dogsList).toContainText('Labrador');
	});

	testRunner('content collections - getEntry()', async ({ page, astro }) => {
		await page.goto(astro.resolveUrl('/'));
		const firstTitle = page.locator('#first-blog-title');
		await expect(firstTitle).toBeVisible();
	});

	testRunner('content collections - render()', async ({ page, astro }) => {
		await page.goto(astro.resolveUrl('/'));
		const content = page.locator('#content');
		await expect(content).toBeVisible();
	});

	testRunner('react component with client:load', async ({ page, astro }) => {
		await page.goto(astro.resolveUrl('/'));
		await expect(page.locator('#framework')).toContainText('Hello from React');
	});

	testRunner('vue component with client:load', async ({ page, astro }) => {
		await page.goto(astro.resolveUrl('/'));
		await expect(page.locator('#framework')).toContainText('Hello from vue component');
	});

	testRunner('preact component with client:load and useEffect', async ({ page, astro }) => {
		await page.goto(astro.resolveUrl('/'));
		const counter = page.locator('#preact-counter');
		await expect(counter).toBeVisible();
		await expect(counter).toContainText('Preact count: 0');
		await counter.locator('button').click();
		await expect(counter).toContainText('Preact count: 1');
	});

	testRunner('server island with server:defer', async ({ page, astro }) => {
		await page.goto(astro.resolveUrl('/'));
		const island = page.locator('#island');
		await expect(island).toContainText('Island time');
	});

// ... (98 more lines)

Domain

Subdomains

Functions

Frequently Asked Questions

What does cloudflare.test.js do?
cloudflare.test.js is a source file in the astro codebase, written in javascript. It belongs to the E2ETesting domain, TestFixtures subdomain.
What functions are defined in cloudflare.test.js?
cloudflare.test.js defines 1 function(s): sharedTests.
What does cloudflare.test.js depend on?
cloudflare.test.js imports 4 module(s): createLoggerSpy, test, test-utils.js, testFactory.
Where is cloudflare.test.js in the architecture?
cloudflare.test.js is located at packages/astro/e2e/cloudflare.test.js (domain: E2ETesting, subdomain: TestFixtures, directory: packages/astro/e2e).

Analyze Your Own Codebase

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

Try Supermodel Free