following the "game of life" example, td.verify with _.isEquality
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- testing-qa
調査の方向性
Start with the game of life example and the second test shown, then inspect td.verify and _.isEquality behavior for seedWorld and seedWorldSecond. Done means the expected comparison behavior is established with a focused test or a clear explanation of how this case should be verified.
索引モデルが issue の本文から書いたものです。
説明
Hello.
I'm trying to follow the game of life discovery testing by Justin Searls , with TypeScript.
I added the second test, without changing the code, and it passes:
test('one generation', () => {
const seedWorld = new World()
td.when(generatesSeedWorld.generate()).thenReturn(seedWorld)
const seedWorldSecond = new World()
simulatesConway.simulate(1, 1337)
td.verify(outputsWorld.output(seedWorld))
td.verify(outputsWorld.output(seedWorldSecond))
})
Because seedWorld is at this moment exactly the same as seedWorldSecond (although it is not THE SAME one). When I added this.random = Math.random() to World constructor, the test properly failes.
I'm trying to understand the principle behind this kind of testing, which should not be language/framework specific as far as I understand.
How would you write a test like this then, in testdouble? Should I somehow force a different comparison mode? For now for learning purposes I'm going to leave the random there, but "there must be a better way" ;-)
Thanks a lot!
- 主要言語
- JavaScript
- スター
- 1.4k
- フォーク
- 141
- 平均マージ
- 2時間 30分
- マージ済み PR(30日)
- 10
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
testdouble/testdouble.js のほかの issue
-
Feature request: `td.func().reset()` (reset spy/stub state)対応中かも @MatrixNeoKozak が 5 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
testdouble/testdouble.js#529 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
testdouble/testdouble.js#296 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
testdouble/testdouble.js#281 · コメント 5 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
testdouble/testdouble.js#276 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
testdouble/testdouble.js#275 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
testdouble/testdouble.js の issue をすべて見る
似ている issue
-
documentation good first issue theming
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
drevendev/PatchPitch#2 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
521xueweihan/HelloGitHub#4025 ·