Is it possible to split the tests into setup, run test, and teardown?
- Langage dominant
- JavaScript
- Étoiles
- 1.9k
- Forks
- 359
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
I am using this basic code to run some test on various sorting algorithms in the same file:
Here is the driver code:
```
var reporter = require('nodeunit').reporters.default;
reporter.run(['tests/sortingTests.js']);
```
This works good so far for my testing needs. But now I am interested in using [benchmark.js](https://github.com/bestiejs/benchmark.js) to benchmark each of those sorting algorithms.
I want to reuse the testing code for the purpose of Benchmarking to reduce redundancy.
Benchmark provides helpful setup and teardown functions in its API. That is important because we don't want to measure the time taken during setup and tear down.
All I want is that in Benchmark's setup function, I should be able to instruct node-unit to run the setup.
And then in measurement function, I tell node-unit to separately run only the test.
And later in Benchmark's teardown function, I should be able to call node-unit's teardown.
And repeat above 3 steps for every test in that same file.
Any ideas how should I go about it?
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par le code du pilote en utilisant nodeunit's default reporter et tests/sortingTests.js, puis examinez les points d’entrée de l’exécution des tests et du cycle de vie de nodeunit parallèlement à l’API de setup, de mesure et de teardown de benchmark.js. Déterminez si les trois phases peuvent être invoquées indépendamment pour chaque test, et documentez ou définissez le comportement d’intégration attendu.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript, node.js
- Domaine
- testing
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100