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

errors.test.js — astro Source File

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

Entity Profile

Dependency Diagram

graph LR
  18440f2c_4ace_0d3a_bc94_65b8cca8fed7["errors.test.js"]
  19e9ce5a_d539_181c_bf35_24680080c2a5["../../../dist/core/errors/errors.js"]
  18440f2c_4ace_0d3a_bc94_65b8cca8fed7 --> 19e9ce5a_d539_181c_bf35_24680080c2a5
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  18440f2c_4ace_0d3a_bc94_65b8cca8fed7 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  18440f2c_4ace_0d3a_bc94_65b8cca8fed7 --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  style 18440f2c_4ace_0d3a_bc94_65b8cca8fed7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import {
	AggregateError,
	AstroError,
	AstroUserError,
	CompilerError,
	CSSError,
	InternalError,
	isAstroError,
	MarkdownError,
} from '../../../dist/core/errors/errors.js';

describe('Error type checking', () => {
	describe('AstroError.is()', () => {
		it('returns true for AstroError instances', () => {
			const error = new AstroError({ name: 'TestError', message: 'Test message' });
			assert.equal(AstroError.is(error), true);
		});

		it('returns false for non-AstroError instances', () => {
			const error = new Error('Regular error');
			assert.equal(AstroError.is(error), false);
		});

		it('returns false for null', () => {
			assert.equal(AstroError.is(null), false);
		});

		it('returns false for undefined', () => {
			assert.equal(AstroError.is(undefined), false);
		});

		it('returns false for primitive values', () => {
			assert.equal(AstroError.is('string'), false);
			assert.equal(AstroError.is(42), false);
			assert.equal(AstroError.is(true), false);
		});
	});

	describe('CompilerError.is()', () => {
		it('returns true for CompilerError instances', () => {
			const error = new CompilerError({ name: 'TestCompilerError', message: 'Test message' });
			assert.equal(CompilerError.is(error), true);
		});

		it('returns false for non-CompilerError instances', () => {
			const error = new AstroError({ name: 'TestError', message: 'Test message' });
			assert.equal(CompilerError.is(error), false);
		});

		it('returns false for null', () => {
			assert.equal(CompilerError.is(null), false);
		});

		it('returns false for undefined', () => {
			assert.equal(CompilerError.is(undefined), false);
		});
	});

// ... (170 more lines)

Dependencies

  • ../../../dist/core/errors/errors.js
  • node:test
  • strict

Frequently Asked Questions

What does errors.test.js do?
errors.test.js is a source file in the astro codebase, written in javascript. It belongs to the IntegrationAdapters domain.
What does errors.test.js depend on?
errors.test.js imports 3 module(s): ../../../dist/core/errors/errors.js, node:test, strict.
Where is errors.test.js in the architecture?
errors.test.js is located at packages/astro/test/units/errors/errors.test.js (domain: IntegrationAdapters, directory: packages/astro/test/units/errors).

Analyze Your Own Codebase

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

Try Supermodel Free