From cae6e512c3af7c9ea2c8df26a8ec0b317cb7e3df Mon Sep 17 00:00:00 2001 From: Roman Mkrtchian Date: Sun, 23 Jun 2024 22:15:08 +0200 Subject: [PATCH] content(tdd by example): correction in code example --- pages/books/test-driven-development-by-example.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/books/test-driven-development-by-example.mdx b/pages/books/test-driven-development-by-example.mdx index 9d8717eb..3e70e1c0 100644 --- a/pages/books/test-driven-development-by-example.mdx +++ b/pages/books/test-driven-development-by-example.mdx @@ -1002,7 +1002,7 @@ class Money implements Expression { // ... reduce(to: string) { - const rate = this.currency === "CHF" && to === "USD"; + const rate = this.currency === "CHF" && to === "USD" ? 2 : 1; return new Money(this.amount / rate, to); } } @@ -1025,7 +1025,7 @@ class Money implements Expression { // ... reduce(bank: Bank, to: string) { - const rate = this.currency === "CHF" && to === "USD"; + const rate = this.currency === "CHF" && to === "USD" ? 2 : 1; return new Money(this.amount / rate, to); } }