Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('return new amend data', async () => {
mockingoose.User.toReturn(userMock, 'findOne')
mockingoose.Amend.toReturn(amendMock, 'findOne')
mockingoose.Amend.toReturn(new Array(amendMock), 'find')
mockingoose.Event.toReturn(new Array(eventMock), 'find')
mockingoose.Text.toReturn(textMock, 'findOne')
const res = await Amend.postAmend(
{
name: 'test',
description: 'test',
patch: 'test',
version: 1,
textID: '5c64389cae3ae3695c711e44'
},
'wrongId'
)
expect(res).toHaveProperty('data')
})
})
test('should return text, texts and event data', async () => {
mockingoose.User.toReturn({ ...userMock, activated: true }, 'findOne')
mockingoose.Text.toReturn(textMock, 'findOne')
mockingoose.Text.toReturn(new Array(textMock), 'find')
mockingoose.Event.toReturn(new Array(eventMock), 'find')
const res = await Text.postText(
{ name: 'test', description: 'test' },
'77g96g983Edz'
)
expect(res).toHaveProperty('data')
})
})
test('should return a list of events', async () => {
mockingoose.Event.toReturn(eventMock, 'find')
expect(typeof (await Event.getEvents())).toBe('object')
})
})