caolan / caolan/nodeunit

setUp and tearDown do not appear to work in the browser

オープン
#212 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
1.9k
フォーク
359
PR マージ指標
30日以内にマージされた PR はありません

説明

Steps to reproduce:
1. Go into the examples/browser folder
2. Open test.html
3. Everything works as expected
4. Add setUp and tearDown functions to suite1.js
5. Refresh the page to rerun the tests

_Defect_: the functions added in step 4 are run just like normal tests

This appears to be a defect in the copy of `nodeunit.js` in the examples/browser folder. The example's version of nodeunit.js has a function `wrapGroup` but this is never called; whereas the node-based `nodeunit.js` in lib/core.js does call this.

(Sorry that I don't understand the code base well enough at the moment to offer a patch.)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

examples/browser/test.html、examples/browser/suite1.js、そして nodeunit.js のブラウザー用コピーから始め、wrapGroup の処理を lib/core.js と比較します。setUp と tearDown を追加した後に test.html を更新し、これらのフックが通常のテストではなく setup と teardown として扱われることを確認します。ブラウザーの例は、それらをテストとして報告せずに実行できるようにします。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, node.js
領域
frontend, testing
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。