Is it possible to split the tests into setup, run test, and teardown?
- 主要言語
- JavaScript
- スター
- 1.9k
- フォーク
- 359
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
nodeunit's default reporter と tests/sortingTests.js を使用してドライバーコードから始め、続いて nodeunit のテスト実行およびライフサイクルのエントリーポイントを、benchmark.js の setup、measurement、teardown API と併せて確認してください。3つのフェーズを各テストで独立して呼び出せるかどうかを判断し、期待される統合動作を文書化または定義してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, node.js
- 領域
- testing
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100