Created
August 23, 2020 11:11
-
-
Save chrisza4/9ccf1a4b28f8b3fb7d417b851b01b08f to your computer and use it in GitHub Desktop.
compare.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('ProductData.update', () => { | |
| it('can update data', () => { | |
| const context = await Database.InitiateWithOneProduct() | |
| const updatedProduct = await ProductData.update(context.product1.id, { name: 'new' }) | |
| expect(updatedProduct.name).toEqual('new') | |
| }) | |
| // ถ้าเทสแบบนี้เวลาเราแก้ ProductData.create ให้เป็นแบบอื่นจนฟังก์ชั่น Update ทำงานด้วยไม่ได้ เทสจะไม่พัง | |
| }) | |
| describe('ProductData.update', () => { | |
| it('can update data', () => { | |
| const product = ProductData.create({ /* ... */ }) | |
| const updatedProduct = await ProductData.update(product.id, { name: 'new' }) | |
| expect(updatedProduct.name).toEqual('new') | |
| }) | |
| // ถ้าเทสแบบนี้เวลาเราแก้ ProductData.create ให้เป็นแบบอื่นจนฟังก์ชั่น Update ทำงานด้วยไม่ได้ เทสจะฟ้องว่าปัจจุบันมัน Incompatible กันแล้ว | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment