javascript-testing-best-practices icon indicating copy to clipboard operation
javascript-testing-best-practices copied to clipboard

Section 1.1 example code should check for true, not false

Open BruceWilliams opened this issue 6 years ago β€’ 2 comments
trafficstars

The second example in section 1.1 says:

expect(result.approved).to.be.false;

It should be:

expect(result.approved).to.be.true;

(I'm guessing you made it false so you could simulate the error output in the next picture.)

BruceWilliams avatar Aug 17 '19 21:08 BruceWilliams

Considering the write put this warning:

A deployment just failed, a test named β€œAdd product” failed. Does this tell you what exactly is malfunctioning?

I doubt this is an error. The writer is trying to demonstrate the use of good test names and how helpful it is to have them when a test fails.

baruchvlz avatar Aug 18 '19 13:08 baruchvlz

@BruceWilliams @baruchvlz Welcome 🎈

I think this is indeed a mistake, and as @baruchvlz said it does not make a lot of difference as the example focused on the name of the test. I'm leaving this issue open until I'll fix it

Thank you

goldbergyoni avatar Aug 19 '19 16:08 goldbergyoni