summaryrefslogtreecommitdiff
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
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
-rw-r--r--.changeset/lemon-papayas-cough.md5
-rw-r--r--packages/create-astro/test/install-step.test.js69
-rw-r--r--packages/create-astro/test/utils.js2
3 files changed, 5 insertions, 71 deletions
diff --git a/.changeset/lemon-papayas-cough.md b/.changeset/lemon-papayas-cough.md
new file mode 100644
index 000000000..19ed2ad34
--- /dev/null
+++ b/.changeset/lemon-papayas-cough.md
@@ -0,0 +1,5 @@
+---
+'create-astro': patch
+---
+
+Chore: remove create-astro install step test
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();
- }
- });
- });
- });
-});
diff --git a/packages/create-astro/test/utils.js b/packages/create-astro/test/utils.js
index 9d227f6b5..b085ef083 100644
--- a/packages/create-astro/test/utils.js
+++ b/packages/create-astro/test/utils.js
@@ -26,8 +26,6 @@ export function promiseWithTimeout(testFn) {
export const PROMPT_MESSAGES = {
directory: 'Where would you like to create your new project?',
template: 'Which template would you like to use?',
- install: (pkgManager) => `Would you like us to run "${pkgManager} install?"`,
- git: 'Initialize a new git repository?',
};
export function setup(args = []) {