1.0.5 • Published 5 years ago
jest-python v1.0.5
jest-python
A jest runner for executing python tests.

Setup
Install
Install with yarn or npm
yarn add --dev jest-python
npm install --save-dev jest-pythonRequirements
Python dependencies
Install via pip/pip3
python3
pytest
pytest-json-reportNode dependencies
Install via yarn (or npm)
yarn add --dev jest
npm install --save-dev jestAdd jest-python as the jest runner
In your package.json
"jest": {
"runner": "jest-python",
"testMatch": [
"**/test_*.py"
],
"moduleFileExtensions": [
"py"
]
}Run
Run Jest
yarn jestRun with pipenv
You can run tests in a pipenv shell.
In the project root create a .env file.
Add a variable VIRTUALENV assigned to the absolute path to the pipfile you wish to source.
VIRTUALENV=/Users/kai/projects/test-jest/PipfileDemonstration config
Extra dependencies
jest-watch-typeahead
yarn add --dev jest-watch-typeaheadConfig used
"jest": {
"runner": "jest-python",
"watchPlugins": [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname"
],
"testMatch": [
"**/test_*.py"
],
"moduleFileExtensions": [
"py"
]
}```