following the "game of life" example, td.verify with _.isEquality
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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!
- Ngôn ngữ chính
- JavaScript
- Star
- 1.4k
- Fork
- 140
- Merge trung bình
- 5 giờ 55 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của testdouble/testdouble.js
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
testdouble/testdouble.js#538 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
testdouble/testdouble.js#537 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
testdouble/testdouble.js#536 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
testdouble/testdouble.js#534 ·
-
`npm-run-all` to `npm-run-all2`Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 45/100
testdouble/testdouble.js#533 ·
Tất cả issue của testdouble/testdouble.js
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
openlibhums/janeway#5604 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Generic OSC does not initialize OSC client on startup when "Listen for Feedback" is disabledĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
area/statement-execution TS conversion
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
scylladb/nodejs-rs-driver#584 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
新讀者走讀回報,照著一篇文章實際操作Đang mởdocumentation good first issue help wanted
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
Maintainer thường phản hồi trong vòng 3 ngày