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

git.test.js — astro Source File

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

Entity Profile

Dependency Diagram

graph LR
  d5350b4d_c35b_4454_334c_d853bf240d76["git.test.js"]
  880e345d_e64a_cd56_e5a1_121b9c58fefd["../dist/index.js"]
  d5350b4d_c35b_4454_334c_d853bf240d76 --> 880e345d_e64a_cd56_e5a1_121b9c58fefd
  a235a0d7_582f_6d3a_e9ba_44a62def6ef3["utils.js"]
  d5350b4d_c35b_4454_334c_d853bf240d76 --> a235a0d7_582f_6d3a_e9ba_44a62def6ef3
  ba39c8a0_fa83_d32e_0c60_ad5c1c131c40["setup"]
  d5350b4d_c35b_4454_334c_d853bf240d76 --> ba39c8a0_fa83_d32e_0c60_ad5c1c131c40
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  d5350b4d_c35b_4454_334c_d853bf240d76 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  e16a223b_37f3_6b25_1ee1_2b7bcb9d9415["node:fs"]
  d5350b4d_c35b_4454_334c_d853bf240d76 --> e16a223b_37f3_6b25_1ee1_2b7bcb9d9415
  5d6d1861_a18d_b246_cd94_08889ab7e74c["promises"]
  d5350b4d_c35b_4454_334c_d853bf240d76 --> 5d6d1861_a18d_b246_cd94_08889ab7e74c
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  d5350b4d_c35b_4454_334c_d853bf240d76 --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  style d5350b4d_c35b_4454_334c_d853bf240d76 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import assert from 'node:assert/strict';
import { rmSync } from 'node:fs';
import { mkdir, writeFile } from 'node:fs/promises';
import { after, before, describe, it } from 'node:test';

import { git } from '../dist/index.js';
import { setup } from './utils.js';

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

	it('none', async () => {
		const context = { cwd: '', dryRun: true, prompt: () => ({ git: false }) };
		await git(context);

		assert.ok(fixture.hasMessage('Skipping Git initialization'));
	});

	it('yes (--dry-run)', async () => {
		const context = { cwd: '', dryRun: true, prompt: () => ({ git: true }) };
		await git(context);
		assert.ok(fixture.hasMessage('Skipping Git initialization'));
	});

	it('no (--dry-run)', async () => {
		const context = { cwd: '', dryRun: true, prompt: () => ({ git: false }) };
		await git(context);

		assert.ok(fixture.hasMessage('Skipping Git initialization'));
	});
});

describe('git initialized', () => {
	const fixture = setup();
	const dir = new URL(new URL('./fixtures/not-empty/.git', import.meta.url));

	before(async () => {
		await mkdir(dir, { recursive: true });
		await writeFile(new URL('./git.json', dir), '{}', { encoding: 'utf8' });
	});

	it('already initialized', async () => {
		const context = {
			git: true,
			cwd: './test/fixtures/not-empty',
			dryRun: false,
			prompt: () => ({ git: false }),
		};
		await git(context);

		assert.ok(fixture.hasMessage('Git has already been initialized'));
	});

	after(() => {
		rmSync(dir, { recursive: true, force: true });
	});
});

Domain

Dependencies

Frequently Asked Questions

What does git.test.js do?
git.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does git.test.js depend on?
git.test.js imports 7 module(s): ../dist/index.js, node:fs, node:test, promises, setup, strict, utils.js.
Where is git.test.js in the architecture?
git.test.js is located at packages/create-astro/test/git.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