Skip to content

Instantly share code, notes, and snippets.

@sogoiii
Last active July 22, 2018 23:00
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 sogoiii/5c5f1787733172bac65b5436c19ff21c to your computer and use it in GitHub Desktop.
Save sogoiii/5c5f1787733172bac65b5436c19ff21c to your computer and use it in GitHub Desktop.
A nested describe test block with multiple it blocks. Each it block only handles 1 assert.
describe('Testing Mycreated fail cases:', async function () {
let result = ''
it('should fail to create an event because eventName is not a string', async function () {
result = await this.Contract.createEvent(123456, _eventDescription, _eventWebsite, _eventDate, _location, { from: mainAccount })
assert.equal(result.receipt.status, hex.fail, 'TX status should fail')
})
it('should have Mycreatd list be empty', async function () {
let CreatedList = await this.Contract.getMyCreatedEvents.call(4, 1)
assert.deepEqual(convertBigNumArr(CreatedList), ['0', '0', '0', '0'])
})
it('should not update getAllEvents', async function () {
let EventList = await this.Contract.getAllEvents.call(4, 1)
assert.deepEqual(convertBigNumArr(EventList), ['0', '0', '0', '0'])
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment