Created
June 18, 2020 09:02
-
-
Save kianaditya/9360dd3f152ba870422bf113a4bfad5f 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 factories = require('../factories') | |
| const db = require('../../src/models') | |
| before(async function () { | |
| try { | |
| const author = await factories.create('User',{email: '[email protected]'}) | |
| const posts = [] | |
| for (let index = 0; index < 4; index++) { | |
| const post = await factories.create('Post') | |
| author.addAuthor(post) | |
| posts.push(post) | |
| } | |
| } catch (error) { | |
| console.error(error) | |
| } | |
| }) | |
| after(async function () { | |
| await db.sequelize.sync({ force: true }) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment