test autocompletes to TestWatcher in VSCode

Viewed 140

I am using VSCode to create and manage some Jest tests in a project.

Whenever I start to type test in a clean file, test autocompletes to TestWatcher and VSCode prepends the line import { TestWatcher } from "jest"; to the file.

I am trying to figure out what is causing this to happen and how to either eliminate it or use it efficiently. Web searches yielded pretty vague results.

2 Answers

The only thing that helped me to resolve it is npm i @types/jest --save-dev. But it seems to be a crunch to install something related to typescript when what I want to do is write pure JS.

UPD Make sure you have installed jest as well. For me, it works only if both jest and @types/jest are installed.

Watch this question Prevent autocomplete in Visual Studio Code

cmd + , to call out settings. Search for acceptSuggestionOnCommitCharacter, then toggle it out.

"editor.acceptSuggestionOnCommitCharacter": false
Related