Home / File/ check.test.ts — astro Source File

check.test.ts — astro Source File

Architecture documentation for check.test.ts, a typescript file in the astro codebase. 7 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  b39f5720_820d_5ba3_c1b3_537a468f68dd["check.test.ts"]
  df4b7409_0a23_a6c7_2759_09a36e416aae["../../dist/check.js"]
  b39f5720_820d_5ba3_c1b3_537a468f68dd --> df4b7409_0a23_a6c7_2759_09a36e416aae
  db323e8c_04ef_9777_0487_224de5819a30["node:assert"]
  b39f5720_820d_5ba3_c1b3_537a468f68dd --> db323e8c_04ef_9777_0487_224de5819a30
  3955a637_4c78_0528_fe7c_92190a232cb0["node:module"]
  b39f5720_820d_5ba3_c1b3_537a468f68dd --> 3955a637_4c78_0528_fe7c_92190a232cb0
  b326953c_dc9d_ec9e_dc34_4beead549f6e["node:os"]
  b39f5720_820d_5ba3_c1b3_537a468f68dd --> b326953c_dc9d_ec9e_dc34_4beead549f6e
  c52a5f83_66e3_37d7_9ebb_767f7129bc62["node:path"]
  b39f5720_820d_5ba3_c1b3_537a468f68dd --> c52a5f83_66e3_37d7_9ebb_767f7129bc62
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  b39f5720_820d_5ba3_c1b3_537a468f68dd --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  d9a92db9_c95e_9165_13ac_24b3d859d946["node:url"]
  b39f5720_820d_5ba3_c1b3_537a468f68dd --> d9a92db9_c95e_9165_13ac_24b3d859d946
  style b39f5720_820d_5ba3_c1b3_537a468f68dd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import assert from 'node:assert';
import { createRequire } from 'node:module';
import os from 'node:os';
import path from 'node:path';
import { before, describe, it } from 'node:test';
import { fileURLToPath } from 'node:url';
import type { CheckResult } from '../../dist/check.js';
import { AstroCheck } from '../../dist/check.js';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const require = createRequire(import.meta.url);
const checkFixtureDir = path.resolve(__dirname, 'fixture');

describe('AstroCheck', async () => {
	let checker: AstroCheck;
	let result: CheckResult;

	before(async () => {
		checker = new AstroCheck(
			checkFixtureDir,
			require.resolve('typescript/lib/typescript.js'),
			undefined,
		);
		result = await checker.lint({});
	});

	it('Can check files and return errors', async () => {
		assert.notStrictEqual(result, undefined);
		assert.strictEqual(result.fileResult.length, 4);
	});

	it("Returns the file's URL", async () => {
		assert.notStrictEqual(result.fileResult[0].fileUrl, undefined);
		assert.strictEqual(result.fileResult[0].fileUrl instanceof URL, true);
	});

	it("Returns the file's content", async () => {
		assert.notStrictEqual(result.fileResult[0].fileContent, undefined);
		assert.deepStrictEqual(
			result.fileResult[0].fileContent,
			`---${os.EOL}console.log(doesntExist);${os.EOL}---${os.EOL}`,
		);
	});

	it('Can return the total amount of errors, warnings and hints', async () => {
		assert.strictEqual(result.errors, 2);
		assert.strictEqual(result.warnings, 1);
		assert.strictEqual(result.hints, 1);
	});

	it('Can return the total amount of files checked', async () => {
		assert.strictEqual(result.fileChecked, 6);
	});

	it('Can return the status of the check', async () => {
		assert.strictEqual(result.status, 'completed');
	});
});

Domain

Dependencies

  • ../../dist/check.js
  • node:assert
  • node:module
  • node:os
  • node:path
  • node:test
  • node:url

Frequently Asked Questions

What does check.test.ts do?
check.test.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain.
What does check.test.ts depend on?
check.test.ts imports 7 module(s): ../../dist/check.js, node:assert, node:module, node:os, node:path, node:test, node:url.
Where is check.test.ts in the architecture?
check.test.ts is located at packages/language-tools/language-server/test/check/check.test.ts (domain: CoreAstro, directory: packages/language-tools/language-server/test/check).

Analyze Your Own Codebase

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

Try Supermodel Free