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

template.test.js — astro Source File

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

Entity Profile

Dependency Diagram

graph LR
  38b9fb55_5742_1a0e_ab8b_c4cd49edbfdd["template.test.js"]
  880e345d_e64a_cd56_e5a1_121b9c58fefd["../dist/index.js"]
  38b9fb55_5742_1a0e_ab8b_c4cd49edbfdd --> 880e345d_e64a_cd56_e5a1_121b9c58fefd
  a235a0d7_582f_6d3a_e9ba_44a62def6ef3["utils.js"]
  38b9fb55_5742_1a0e_ab8b_c4cd49edbfdd --> a235a0d7_582f_6d3a_e9ba_44a62def6ef3
  ba39c8a0_fa83_d32e_0c60_ad5c1c131c40["setup"]
  38b9fb55_5742_1a0e_ab8b_c4cd49edbfdd --> ba39c8a0_fa83_d32e_0c60_ad5c1c131c40
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  38b9fb55_5742_1a0e_ab8b_c4cd49edbfdd --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  38b9fb55_5742_1a0e_ab8b_c4cd49edbfdd --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  style 38b9fb55_5742_1a0e_ab8b_c4cd49edbfdd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { template } from '../dist/index.js';
import { setup } from './utils.js';

describe('template', async () => {
	const fixture = setup();

	it('none', async () => {
		const context = { template: '', cwd: '', dryRun: true, prompt: () => ({ template: 'blog' }) };
		await template(context);
		assert.ok(fixture.hasMessage('Skipping template copying'));
		assert.equal(context.template, 'blog');
	});

	it('minimal (--dry-run)', async () => {
		const context = { template: 'minimal', cwd: '', dryRun: true, prompt: () => {} };
		await template(context);
		assert.ok(fixture.hasMessage('Using minimal as project template'));
	});

	it('basics (--dry-run)', async () => {
		const context = { template: 'basics', cwd: '', dryRun: true, prompt: () => {} };
		await template(context);
		assert.ok(fixture.hasMessage('Using basics as project template'));
	});

	it('blog (--dry-run)', async () => {
		const context = { template: 'blog', cwd: '', dryRun: true, prompt: () => {} };
		await template(context);
		assert.ok(fixture.hasMessage('Using blog as project template'));
	});

	it('minimal (--yes)', async () => {
		const context = { template: 'minimal', cwd: '', dryRun: true, yes: true, prompt: () => {} };
		await template(context);
		assert.ok(fixture.hasMessage('Using minimal as project template'));
	});
});

Domain

Dependencies

Frequently Asked Questions

What does template.test.js do?
template.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does template.test.js depend on?
template.test.js imports 5 module(s): ../dist/index.js, node:test, setup, strict, utils.js.
Where is template.test.js in the architecture?
template.test.js is located at packages/create-astro/test/template.test.js (domain: CoreAstro, directory: packages/create-astro/test).

Analyze Your Own Codebase

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

Try Supermodel Free