mirror of
https://github.com/withastro/astro.git
synced 2025-01-20 22:12:38 -05:00
9263e96593
Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com> Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> Co-authored-by: Reuben Tier <otterlord.dev@gmail.com>
60 lines
1.3 KiB
JavaScript
60 lines
1.3 KiB
JavaScript
import assert from 'node:assert/strict';
|
|
import { describe, it } from 'node:test';
|
|
import { dependencies } from '../dist/index.js';
|
|
import { setup } from './utils.js';
|
|
describe('integrations', () => {
|
|
const fixture = setup();
|
|
|
|
it('--add node', async () => {
|
|
const context = {
|
|
cwd: '',
|
|
yes: true,
|
|
packageManager: 'npm',
|
|
dryRun: true,
|
|
add: ['node'],
|
|
};
|
|
|
|
await dependencies(context);
|
|
|
|
assert.ok(fixture.hasMessage('--dry-run Skipping dependency installation and adding node'));
|
|
});
|
|
|
|
it('--add node --add react', async () => {
|
|
const context = {
|
|
cwd: '',
|
|
yes: true,
|
|
packageManager: 'npm',
|
|
dryRun: true,
|
|
add: ['node', 'react'],
|
|
};
|
|
|
|
await dependencies(context);
|
|
|
|
assert.ok(fixture.hasMessage('--dry-run Skipping dependency installation and adding node, react'));
|
|
});
|
|
|
|
it('--add node,react', async () => {
|
|
const context = {
|
|
cwd: '',
|
|
yes: true,
|
|
packageManager: 'npm',
|
|
dryRun: true,
|
|
add: ['node,react']
|
|
};
|
|
|
|
await dependencies(context);
|
|
|
|
assert.ok(fixture.hasMessage('--dry-run Skipping dependency installation and adding node, react'));
|
|
});
|
|
|
|
it('-y', async () => {
|
|
const context = {
|
|
cwd: '',
|
|
yes: true,
|
|
packageManager: 'npm',
|
|
dryRun: true,
|
|
};
|
|
await dependencies(context);
|
|
assert.ok(fixture.hasMessage('--dry-run Skipping dependency installation'));
|
|
});
|
|
});
|