summaryrefslogtreecommitdiff
path: root/packages/create-astro/test/install-step.test.js
diff options
context:
space:
mode:
authorGravatar Ben Holmes <hey@bholmes.dev> 2022-06-28 13:46:54 -0400
committerGravatar GitHub <noreply@github.com> 2022-06-28 13:46:54 -0400
commit507cd5c868448971c6265d97f22e786263dd5a77 (patch)
tree7733d3e0166d3a585eb6e89894edeaeaa26b8fe5 /packages/create-astro/test/install-step.test.js
parentcabd9dcc8079b55bf16bf05da53bd36f41b7f766 (diff)
downloadastro-507cd5c868448971c6265d97f22e786263dd5a77.tar.gz
astro-507cd5c868448971c6265d97f22e786263dd5a77.tar.zst
astro-507cd5c868448971c6265d97f22e786263dd5a77.zip
Chore: remove complex install step test (#3756)
* chore: remove complex install step test * chore: changeset
Diffstat (limited to 'packages/create-astro/test/install-step.test.js')
-rw-r--r--packages/create-astro/test/install-step.test.js69
1 files changed, 0 insertions, 69 deletions
diff --git a/packages/create-astro/test/install-step.test.js b/packages/create-astro/test/install-step.test.js
deleted file mode 100644
index 78d014257..000000000
--- a/packages/create-astro/test/install-step.test.js
+++ /dev/null
@@ -1,69 +0,0 @@
-import { setup, promiseWithTimeout, timeout, PROMPT_MESSAGES } from './utils.js';
-import { sep } from 'path';
-import fs from 'fs';
-import os from 'os';
-
-const FAKE_PACKAGE_MANAGER = 'banana';
-let initialEnvValue = null;
-
-// TODO: enable test, it was consistently timing out in CI
-describe.skip('[create-astro] install', function () {
- this.timeout(timeout);
- let tempDir = '';
- beforeEach(async () => {
- tempDir = await fs.promises.mkdtemp(`${os.tmpdir()}${sep}`);
- });
- this.beforeAll(() => {
- initialEnvValue = process.env.npm_config_user_agent;
- process.env.npm_config_user_agent = FAKE_PACKAGE_MANAGER;
- });
- this.afterAll(() => {
- process.env.npm_config_user_agent = initialEnvValue;
- });
-
- it('should respect package manager in prompt', function () {
- const { stdout, stdin } = setup([tempDir]);
- return promiseWithTimeout((resolve) => {
- const seen = new Set();
- const installPrompt = PROMPT_MESSAGES.install(FAKE_PACKAGE_MANAGER);
- stdout.on('data', (chunk) => {
- if (!seen.has(PROMPT_MESSAGES.template) && chunk.includes(PROMPT_MESSAGES.template)) {
- seen.add(PROMPT_MESSAGES.template);
- // respond with "enter key"
- stdin.write('\x0D');
- }
- if (!seen.has(installPrompt) && chunk.includes(installPrompt)) {
- seen.add(installPrompt);
- resolve();
- }
- });
- });
- });
-
- it('should respect package manager in next steps', function () {
- const { stdout, stdin } = setup([tempDir]);
- return promiseWithTimeout((resolve) => {
- const seen = new Set();
- const installPrompt = PROMPT_MESSAGES.install(FAKE_PACKAGE_MANAGER);
- stdout.on('data', (chunk) => {
- if (!seen.has(PROMPT_MESSAGES.template) && chunk.includes(PROMPT_MESSAGES.template)) {
- seen.add(PROMPT_MESSAGES.template);
- // respond with "enter key"
- stdin.write('\x0D');
- }
- if (!seen.has(installPrompt) && chunk.includes(installPrompt)) {
- seen.add(installPrompt);
- // respond with "no, then enter key"
- stdin.write('n\x0D');
- }
- if (!seen.has(PROMPT_MESSAGES.git) && chunk.includes(PROMPT_MESSAGES.git)) {
- seen.add(PROMPT_MESSAGES.git);
- stdin.write('\x0D');
- }
- if (chunk.includes('banana dev')) {
- resolve();
- }
- });
- });
- });
-});