aboutsummaryrefslogtreecommitdiff
path: root/packages/create-astro/test/integrations.test.js
diff options
context:
space:
mode:
authorGravatar Erika <3019731+Princesseuh@users.noreply.github.com> 2024-11-04 16:15:11 +0100
committerGravatar GitHub <noreply@github.com> 2024-11-04 16:15:11 +0100
commit9263e965932b9a6a116801c063c6b7105c39643e (patch)
tree8ed6e7f9b048752d70d53744eefbda2166cbcbb9 /packages/create-astro/test/integrations.test.js
parent731b69712b0e9c5d5a4058db3fa3e8bf628c7aad (diff)
downloadastro-9263e965932b9a6a116801c063c6b7105c39643e.tar.gz
astro-9263e965932b9a6a116801c063c6b7105c39643e.tar.zst
astro-9263e965932b9a6a116801c063c6b7105c39643e.zip
create-astro updates (#12083)
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>
Diffstat (limited to 'packages/create-astro/test/integrations.test.js')
-rw-r--r--packages/create-astro/test/integrations.test.js60
1 files changed, 60 insertions, 0 deletions
diff --git a/packages/create-astro/test/integrations.test.js b/packages/create-astro/test/integrations.test.js
new file mode 100644
index 000000000..8e27a3cfa
--- /dev/null
+++ b/packages/create-astro/test/integrations.test.js
@@ -0,0 +1,60 @@
+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'));
+ });
+});