nodejs-integration-tests-best-practices icon indicating copy to clipboard operation
nodejs-integration-tests-best-practices copied to clipboard

✅ Beyond the basics of Node.js testing. Including a super-comprehensive best practices list and an example app (March 2024)

Results 46 nodejs-integration-tests-best-practices issues
Sort by recently updated
recently updated
newest added

[Here](https://github.com/testjavascript/nodejs-integration-tests-best-practices/blob/81fd70a04f3027213190c30459fae84d72fe932e/various-receipes/authentication/test/auth-example-with-stub.test.js#L12) we use sinon.stub in beforeAll. This way we provide only one stub for the whole suite, which cannot be restored later. Should we always stub inside beforeEach or the...

As we arrange some tests with: `process.env.SEND_MAILS = "true";` We need to clean this value on end but we cannot simply set it to “false” as it might actually originally...

experiment

Intergation tests are powerful becuase they allow testing the dark parts of the engine. Migrations are one of the darkest corners. Two proposed tests: - Undo all migrations without failures...

experiment

Some tests are grey-box tests (e.g. they stub some code object) and can only get executed against the local env. Otheres are pure black-box, they approach the API and don't...

experiment

Here is a recommended eslint config: ``` { "plugins": ["@typescript-eslint/eslint-plugin", "jest"], "extends": [ "plugin:security/recommended", "plugin:promise/recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", "plugin:import/errors", "plugin:import/warnings", "plugin:import/typescript", "prettier", "prettier/@typescript-eslint" ], "root": true, "env": { "node": true, "jest":...

for-release

@jhenaoz @Thormod @mikicho Trying to focus on releasing the great materials that we have here. How about the following simple plan: 1. Now until Dec 18th - At your convenient...

Golden rule - A test visitor will always find the failure reason within the test or at the worst case in the nearest hook. Practically: - If the intercepted request...

@jhenaoz @mikicho @Thormod I'm excited to kick-off this project which I find to be super-important. We all know how tricky is perfecting the environment and the integration tests themselves. This...

We have a user which has a few comments. When we delete the user, we should delete all its comments as well. How can we test that the **comments** get...