How can I activate autocomplete for absolute path in jest test files in VS Code

Viewed 157

I'm using the absolute path for imports in test.js(jest) files like below

import indexStore from '@/store/index'
import { SetExternalId } from '@/adapters/transfers/SetExternalId'
import { FileTransferHandler } from '@/lib/FileTransferHandler'

by using moduleNameMapper in jest.config.js.

 moduleNameMapper: {
    "^@/(.*)$": "<rootDir>/src/$1"
  },

But VS Code doesn't support for autocomplete feature when writing imports!

Autocomplete isn't supported:

enter image description here

Autocomplete for absolute path imports is supported for other files like .vue, .ts files but for test.js files.

How can I use autocomplete feature for absolute path imports in test files?

0 Answers
Related