Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dia 04: verificando se o palpite está correto
- Loading branch information
1 parent
64bae24
commit 8f43da8
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const app = require('../resources/scripts/app') | ||
|
||
describe('Checking the guess is correct', () => { | ||
test('should return true because guess is equals to right guess', () => { | ||
expect(app.isCorrectGuess('allow', 'allow')).toBe(true) | ||
expect(app.isCorrectGuess('ahead', 'ahead')).toBe(true) | ||
expect(app.isCorrectGuess('badge', 'badge')).toBe(true) | ||
expect(app.isCorrectGuess('house', 'house')).toBe(true) | ||
expect(app.isCorrectGuess('sorry', 'sorry')).toBe(true) | ||
}) | ||
|
||
test('should return false because the guess is not equals to right guess', () => { | ||
expect(app.isCorrectGuess('house', 'ahead')).toBe(false) | ||
expect(app.isCorrectGuess('badge', 'beach')).toBe(false) | ||
expect(app.isCorrectGuess('actor', 'agent')).toBe(false) | ||
expect(app.isCorrectGuess('worry', 'sorry')).toBe(false) | ||
expect(app.isCorrectGuess('allow', 'below')).toBe(false) | ||
}) | ||
}) |