Last active
May 29, 2019 21:06
-
-
Save bradfordlemley/8be1905b53778b84247ca4dfbca0d7a6 to your computer and use it in GitHub Desktop.
Todo library test
This file contains hidden or 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("Adds todos", () => { | |
const todoLib = createTodoLib(); | |
todoLib.addTodo("First todo"); | |
expect(todoLib.state.todos).toHaveLength(1); | |
expect(todoLib.state.activeTodos).toHaveLength(1); | |
expect(todoLib.state.completedTodos).toHaveLength(0); | |
todoLib.addTodo("Second Todo"); | |
expect(todoLib.state.todos).toHaveLength(2); | |
expect(todoLib.state.activeTodos).toHaveLength(2); | |
expect(todoLib.state.completedTodos).toHaveLength(0); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment