2024-11-04 10:15:11 -05:00
|
|
|
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);
|
|
|
|
|
2024-11-06 10:34:10 -05:00
|
|
|
assert.ok(
|
|
|
|
fixture.hasMessage('--dry-run Skipping dependency installation and adding node, react'),
|
|
|
|
);
|
2024-11-04 10:15:11 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
it('--add node,react', async () => {
|
|
|
|
const context = {
|
|
|
|
cwd: '',
|
|
|
|
yes: true,
|
|
|
|
packageManager: 'npm',
|
|
|
|
dryRun: true,
|
2024-11-06 10:34:10 -05:00
|
|
|
add: ['node,react'],
|
2024-11-04 10:15:11 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
await dependencies(context);
|
|
|
|
|
2024-11-06 10:34:10 -05:00
|
|
|
assert.ok(
|
|
|
|
fixture.hasMessage('--dry-run Skipping dependency installation and adding node, react'),
|
|
|
|
);
|
2024-11-04 10:15:11 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
it('-y', async () => {
|
|
|
|
const context = {
|
|
|
|
cwd: '',
|
|
|
|
yes: true,
|
|
|
|
packageManager: 'npm',
|
|
|
|
dryRun: true,
|
|
|
|
};
|
|
|
|
await dependencies(context);
|
|
|
|
assert.ok(fixture.hasMessage('--dry-run Skipping dependency installation'));
|
|
|
|
});
|
|
|
|
});
|