Last active
July 27, 2016 19:06
-
-
Save jonpitch/eb3bed80fb5f9031dd9cc5c7519e5ee9 to your computer and use it in GitHub Desktop.
write better ember tests - be verbose
This file contains 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
test('this is a dummy test', function(assert) { | |
const a = true; | |
const b = true; | |
// a developer can quickly scan these messages to understand what | |
// needs to happen and why. | |
assert.ok(a, 'A is true when X'); | |
assert.equal(a, b, 'A and B are equal when X'); | |
}); |
This file contains 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
// bad - what part of login are we testing? | |
test('login', function(assert) { | |
// ... | |
}); | |
// good - i know exactly what this test is doing | |
test('user can successfully log in', function(assert) { | |
// ... | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment