Skip to content

Instantly share code, notes, and snippets.

@tehvicke
Created February 14, 2020 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tehvicke/aef13f314cd3e3a56265943b559bf387 to your computer and use it in GitHub Desktop.
Save tehvicke/aef13f314cd3e3a56265943b559bf387 to your computer and use it in GitHub Desktop.
Simple test to ensure data can be created in the database
afterEach(async () => {
Thought.deleteMany({})
})
describe('thought model tests', () => {
it('can create a thought', async () => {
await new Thought({ message: 'test thought' }).save()
const thoughtsCount = await Thought.countDocuments()
expect(thoughtsCount).toEqual(1)
}),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment