> For the complete documentation index, see [llms.txt](https://docs.newbot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.newbot.io/unit-tests/test-the-events.md).

# Test the events

Here is an event

```typescript
@Event('on', 'myevent') 
start() {
    > Hello :event
}
```

The test :

```javascript
import assert from 'assert'
import { ConverseTesting } from 'newbot/testing'
import mainSkill from './main'

describe('My own test', () => {
    let converse, userConverse

    beforeEach(() => {
        converse = new ConverseTesting(mainSkill)
        userConverse = converse.createUser()
    })

    test('Test Event', () => {
        return userConverse
            .event('myevent', 'sam', testing => {
                assert.equal(testing.output(0), 'Hello sam')
            })
            .end()
    })
})
```

Let's use the `event()` method to run an event in the script

> We can ignore the second parameter if we do not use the magic variable `:event`:

```javascript
userConverse.event('myevent', testing => { })
```
