VS code turns ‘it’ into ‘hasUncaughtExceptionCaptureCallback’. How to disable this?

I am going through a book on Test Driven Development in React. I’ve never written JavaScript tests before. The author presents the following Jest code in a file titled calc.test.js:

var add = require('./calc.js')

describe('calculator',function() {
  it('add two numbers',function() {

but VS code automatically translates it to:

const { hasUncaughtExceptionCaptureCallback } = require('process')
const { isTypedArray } = require('util/types')
var add = require('./calc.js')
describe('calculator', function () {
    isTypedArray('add two numbers', function () {
        hasUncaughtExceptionCaptureCallback(add(1, 2).toEqual(3))

The author states that his version uses syntax “borrowed from” jasmine. Is that why VS Code changed it? How do I turn this feature off? Jest is installed.


Seems like vscode tries to autocomplete it and expect, and auto imports the modules process and utils/types.
Even though manually importing isn’t required per the jest documentation:

In your test files, Jest puts each of these methods and objects into the global environment. You don’t have to require or import anything to use them. However, if you prefer explicit imports, you can do import {describe, expect, test} from ‘@jest/globals’.

You can silence vscode warnings by explicitly importing:

import {describe, expect, test} from '@jest/globals'