Diving deeper into unit testing vanilla JavaScript

On Friday, we looked at unit testing with vanilla JS. Today, we’re going to learn about some advanced matcher methods you can use.

On Friday, we looked at unit testing with vanilla JS. Today, we’re going to learn about some advanced matcher methods you can use.

You could build an entire suite of tests using just the expect.toBe() matcher. But Jest includes a bunch of other matcher methods to make testing a bit easier.

For example, we’re currently testing that the name variable works like this.

Deine Anmeldung konnte nicht gespeichert werden. Bitte versuche es erneut.
Danke für dein Vertrauen

Uns ist wichtig, dass unsere Inhalte rund um die Berufsbildung kostenlos für dich da sind. Wenn du magst, teil deine Kontaktdaten mit uns – so können wir noch besser auf dich eingehen. Danke!