caolan / caolan/nodeunit

Double hash stream read causes test to fail

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

説明

When I run nodeunit on the following code:

``` javascript
var crypto = require('crypto');

exports.wtf = function(test) {

var hash1 = crypto.createHash('sha256');
var hash2 = crypto.createHash('sha256');

hash2.on('readable', function() {
hash2.read(4); // comment this line and test passes
test.done();
});

hash1.pipe(hash2);
hash1.end(new Buffer(1000));
};
```

it fails with the error "TypeError: Cannot read property'setup' of undefined". If I comment out the indicated line, the test passes.

This is with node v0.10.6 and nodeunit 0.8.0 on Windows 8.

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

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

調査の方向性

提供された nodeunit 0.8.0 の例を Node v0.10.6 で再現し、失敗する hash2.read(4) のケースと成功するバージョンを比較します。まず、readable callback 中に nodeunit が test.done() をどのように処理しているかを追跡し、TypeError "setup" の発生源を特定します。再現が失敗しなくなり、既存の成功する動作が維持されていれば完了です。

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

評価

技術スタック
javascript, node.js
領域
testing
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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