Your command is correct when used in a cmd terminal but powershell works differently.
See https://github.com/npm/cli/issues/3136
The 3 suggestions work for me
'--'
---
-- --
I have opened a docs issue with jest
See Terminal Shells for controlling terminals in vscode.