Link Search Menu Expand Document

Running your test

You can always use your test runner of choice (Jest, Pytest, etc) to run your tests, but Ponicode also allows you to run your tests directly in the Ponicode interface.

There are two modes for running your tests: manual mode or watch mode.

Manual mode

You can run each test individually by clicking on the Play button.

If the test passed, you will see a green check right of your test row.

If the test fails, you will see a red cross () icon. You can then make the test pass by clicking on the bolt icon () to correct it.

Watch mode

Watch mode can automaticaly run your tests when needed. You can enable it using the toggle in to top right corner.

Troubleshooting

“Failed to import some files”

This probably means that you have a typo in your imports or that the module you are importing is not installed.

“Failed to evaluate beforeEach”

before_each_error

This usually means that there is a syntax error in the before each. Make sure that all your identifier are imported in the test file and that your classes are instatiated correctly.

Running your test in the terminal (JS)

Ponicode write your test in jest format. You can run the tests in your terminal with jest. Jest is installed with this command: npm install --save-dev jest or yarn add --dev jest

Then add this configuration to your package.json:

{
	"scripts": {
		"test": "test"
	}
}

You can run all your tests with npm run test or yarn run test

You can run tests files individually with jest FILE_NAME.test.js

For advanced use of Jest, refer to the official docs.

> Currying