dependencies.test.js — astro Source File
Architecture documentation for dependencies.test.js, a javascript file in the astro codebase. 5 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR ddac90fe_8275_c906_e848_154bf1806032["dependencies.test.js"] 880e345d_e64a_cd56_e5a1_121b9c58fefd["../dist/index.js"] ddac90fe_8275_c906_e848_154bf1806032 --> 880e345d_e64a_cd56_e5a1_121b9c58fefd a235a0d7_582f_6d3a_e9ba_44a62def6ef3["utils.js"] ddac90fe_8275_c906_e848_154bf1806032 --> a235a0d7_582f_6d3a_e9ba_44a62def6ef3 ba39c8a0_fa83_d32e_0c60_ad5c1c131c40["setup"] ddac90fe_8275_c906_e848_154bf1806032 --> ba39c8a0_fa83_d32e_0c60_ad5c1c131c40 e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"] ddac90fe_8275_c906_e848_154bf1806032 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607 6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"] ddac90fe_8275_c906_e848_154bf1806032 --> 6b0635f9_51ea_77aa_767b_7857878e98a6 style ddac90fe_8275_c906_e848_154bf1806032 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { dependencies } from '../dist/index.js';
import { setup } from './utils.js';
describe('dependencies', () => {
const fixture = setup();
it('--yes', async () => {
const context = {
cwd: '',
yes: true,
packageManager: 'npm',
dryRun: true,
prompt: () => ({ deps: true }),
};
await dependencies(context);
assert.ok(fixture.hasMessage('Skipping dependency installation'));
});
it('prompt yes', async () => {
const context = {
cwd: '',
packageManager: 'npm',
dryRun: true,
prompt: () => ({ deps: true }),
install: undefined,
};
await dependencies(context);
assert.ok(fixture.hasMessage('Skipping dependency installation'));
assert.equal(context.install, true);
});
it('prompt no', async () => {
const context = {
cwd: '',
packageManager: 'npm',
dryRun: true,
prompt: () => ({ deps: false }),
install: undefined,
};
await dependencies(context);
assert.ok(fixture.hasMessage('Skipping dependency installation'));
assert.equal(context.install, false);
});
it('--install', async () => {
const context = {
cwd: '',
install: true,
packageManager: 'npm',
dryRun: true,
prompt: () => ({ deps: false }),
};
await dependencies(context);
assert.ok(fixture.hasMessage('Skipping dependency installation'));
assert.equal(context.install, true);
});
it('--no-install ', async () => {
const context = {
cwd: '',
install: false,
packageManager: 'npm',
dryRun: true,
prompt: () => ({ deps: false }),
};
await dependencies(context);
assert.ok(fixture.hasMessage('Skipping dependency installation'));
assert.equal(context.install, false);
});
describe('--add', async () => {
it('fails for non-supported integration', async () => {
let context = {
cwd: '',
add: ['foo '],
dryRun: true,
prompt: () => ({ deps: false }),
};
try {
await dependencies(context);
assert.fail('The function should throw an error');
} catch (error) {
assert.ok(
error.message.includes('Invalid package name "foo "'),
`Expected error about invalid package name, got: ${error.message}`,
);
}
context = {
cwd: '',
add: ['react', 'bar lorem'],
dryRun: true,
prompt: () => ({ deps: false }),
};
try {
await dependencies(context);
assert.fail('The function should throw an error');
} catch (error) {
assert.ok(
error.message.includes('Invalid package name "bar lorem"'),
`Expected error about invalid package name, got: ${error.message}`,
);
}
});
});
});
Domain
Source
Frequently Asked Questions
What does dependencies.test.js do?
dependencies.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does dependencies.test.js depend on?
dependencies.test.js imports 5 module(s): ../dist/index.js, node:test, setup, strict, utils.js.
Where is dependencies.test.js in the architecture?
dependencies.test.js is located at packages/create-astro/test/dependencies.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