Last active
October 4, 2019 12:30
-
-
Save radzserg/e53577a02d5e9c815c0c0832cefb8903 to your computer and use it in GitHub Desktop.
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
| const repo = new PostsRepo(knex); | |
| it("updates existing post", async () => { | |
| await knex("users").insert({ id: 1, first_name: "John", last_name: "doe" }); | |
| await knex("posts").insert({ id: 2, user_id: 1, title: "Post Title", body: "body"}); | |
| repo.updatePost(1, { title: "title 2" }); | |
| const [updatedPost] = await knex("posts").where({ id: 2 }); | |
| expect(updatedPost.title).toEqual("title 2"); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment