Add support for Jest runner

Summary:
This diff adds compatibility with https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest and makes sure the `yarn jest` command works without further arguments by defaulting to the unit test setup.

This makes tests runnable from VSCode, highlights which tests passed, and show errors inline (and coverage as well if desired), and will report failing tests in the problems panel.

{F235815220}

The debugger can be started right from the code pane as well by clicking the tiny 'debug'

{F235815208}

Currently set up the defaults to not start tests after startup, as it can be CPU hogging, so simply run the command CMD+SHIFT+P 'start jest runner' instead.

Reviewed By: passy

Differential Revision: D21325241

fbshipit-source-id: 7b87297a710a18bbac394110dc2006218ccc7d86
This commit is contained in:
Michel Weststrate
2020-04-30 06:30:04 -07:00
committed by Facebook GitHub Bot
parent b474ef24e0
commit 5db7820820
4 changed files with 43 additions and 27 deletions

View File

@@ -26,5 +26,10 @@
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
},
"jest.autoEnable": false,
"jest.enableInlineErrorMessages": true,
"jest.runAllTestsFirst": false,
"jest.pathToConfig": "jest.config.js",
"jest.pathToJest": "node_modules/.bin/jest"
}