Skip to content

Commit

Permalink
fix: prevent promptEditorHelper to run if running tests in vscode (#4863
Browse files Browse the repository at this point in the history
)

* fix: prevent promtEditorHelper to run if running tests in vscode

* Add comment to node env test check

Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com>

* fix: get rid of linting errors

Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com>
  • Loading branch information
khendrikse and eduardoboucas committed Jul 26, 2022
1 parent 1d63b08 commit 7b89caf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/edge-functions/editor-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const { runRecipe } = require('../../commands/recipes')
const STATE_PROMPT_PROPERTY = 'promptVSCodeSettings'

const promptEditorHelper = async ({ NETLIFYDEVLOG, chalk, config, log, repositoryRoot, state }) => {
// This prevents tests from hanging when running them inside the VS Code
// terminal, as otherwise we'll show the prompt and wait for a response.
if (env.NODE_ENV === 'test') return

const isVSCode = env.TERM_PROGRAM === 'vscode'
const hasShownPrompt = Boolean(state.get(STATE_PROMPT_PROPERTY))
const hasEdgeFunctions = Boolean(config.edge_functions && config.edge_functions.length !== 0)
Expand Down

1 comment on commit 7b89caf

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

Package size: 221 MB

Please sign in to comment.