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

events.test.js — astro Source File

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

Entity Profile

Dependency Diagram

graph LR
  48585cb3_4da6_b2e9_10c4_98fb15714cc0["events.test.js"]
  19e9ce5a_d539_181c_bf35_24680080c2a5["../../../dist/core/errors/errors.js"]
  48585cb3_4da6_b2e9_10c4_98fb15714cc0 --> 19e9ce5a_d539_181c_bf35_24680080c2a5
  df111573_260e_3eeb_9fb9_0f4fdbd0f6af["../../../dist/core/errors/errors-data.js"]
  48585cb3_4da6_b2e9_10c4_98fb15714cc0 --> df111573_260e_3eeb_9fb9_0f4fdbd0f6af
  75153dd2_adf2_992a_d4e1_e1d927fe60f3["../dist/events/index.js"]
  48585cb3_4da6_b2e9_10c4_98fb15714cc0 --> 75153dd2_adf2_992a_d4e1_e1d927fe60f3
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  48585cb3_4da6_b2e9_10c4_98fb15714cc0 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  48585cb3_4da6_b2e9_10c4_98fb15714cc0 --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  style 48585cb3_4da6_b2e9_10c4_98fb15714cc0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { AstroError } from '../dist/core/errors/errors.js';
import { ClientAddressNotAvailable } from '../dist/core/errors/errors-data.js';
import * as events from '../dist/events/index.js';

describe('Events', () => {
	describe('eventCliSession()', () => {
		it('string literal "build.format" is included', () => {
			const config = {
				srcDir: 1,
				build: {
					format: 'file',
				},
			};
			const [{ payload }] = events.eventCliSession(
				{
					cliCommand: 'dev',
				},
				config,
			);
			assert.equal(payload.config.build.format, 'file');
		});

		it('string literal "markdown.syntaxHighlight" is included', () => {
			const config = {
				markdown: {
					syntaxHighlight: 'shiki',
				},
			};
			const [{ payload }] = events.eventCliSession(
				{
					cliCommand: 'dev',
				},
				config,
			);
			assert.equal(payload.config.markdown.syntaxHighlight, 'shiki');
		});

		it('top-level vite keys are captured', async () => {
			const config = {
				root: 'some/thing',
				vite: {
					css: { modules: [] },
					base: 'a',
					mode: 'b',
					define: {
						a: 'b',
					},
					publicDir: 'some/dir',
				},
			};

			const [{ payload }] = events.eventCliSession(
				{
					cliCommand: 'dev',
				},
				config,
			);
			assert.deepEqual(Object.keys(payload.config.vite), [
// ... (179 more lines)

Dependencies

  • ../../../dist/core/errors/errors-data.js
  • ../../../dist/core/errors/errors.js
  • ../dist/events/index.js
  • node:test
  • strict

Frequently Asked Questions

What does events.test.js do?
events.test.js is a source file in the astro codebase, written in javascript. It belongs to the IntegrationAdapters domain.
What does events.test.js depend on?
events.test.js imports 5 module(s): ../../../dist/core/errors/errors-data.js, ../../../dist/core/errors/errors.js, ../dist/events/index.js, node:test, strict.
Where is events.test.js in the architecture?
events.test.js is located at packages/astro/test/events.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