javascript-koans icon indicating copy to clipboard operation
javascript-koans copied to clipboard

Update AboutExpects.js

Open batmansid opened this issue 11 years ago • 1 comments

batmansid avatar Nov 11 '14 14:11 batmansid

@batmansid: Thanks for submitting a pull request (PR). Also, sorry for the delay.

Your PR will generate three problems.

Problem 1: global scope and undefined value

Changing this line: var expectedValue = FILL_ME_IN; to var expectedValue = reality; will declare a global variable named reality and assign it to a default value of undefined.

Problem 2: inability to pass this test

This problem is exacerbated when we view this line of code: expect(actualValue === expectedValue).toBeTruthy(); In other words, there's no way to make the expression actualValue === expectedValue evaluate to true if var expectedValue = reality;. Both of those variables would contain static values: 2 === undefined

Problem 3: semantics

Changing this line: "should expect equality" to "should expect reality" would be incorrect because we're testing for equality with the ===.

choskim avatar Dec 16 '15 06:12 choskim