Skip to content

Commit

Permalink
Adding some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
javisantos committed Mar 12, 2020
1 parent 40eddce commit 9fd553a
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 5 deletions.
5 changes: 2 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 55 additions & 2 deletions test/lorena-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,55 @@ describe('Lorena API', function () {
const username = 'username123456'
const password = 'password'

it('should contruct a Lorena class', async () => {
it('should contruct a Lorena class with server', async () => {
lorena = new Lorena('server')
expect(lorena).to.have.keys([

'matrix',
'zenroom',
'roomId',
'nextBatch',
'recipeId',
'matrixUser',
'matrixPass',
'did',
// 'on',
// 'off',
// 'emit',
'_events',
'_eventsCount',
'_maxListeners',
'processing',
'queue',
'ready'
])
})

it('should contruct a Lorena class without params', async () => {
lorena = new Lorena()
expect(lorena).to.have.keys([

'matrix',
'zenroom',
'roomId',
'nextBatch',
'recipeId',
'matrixUser',
'matrixPass',
'did',
// 'on',
// 'off',
// 'emit',
'_events',
'_eventsCount',
'_maxListeners',
'processing',
'queue',
'ready'
])
})

it('should contruct a Lorena class with debug', async () => {
lorena = new Lorena({ debug: true })
expect(lorena).to.have.keys([

Expand Down Expand Up @@ -63,7 +111,12 @@ describe('Lorena API', function () {
expect(ready).to.have.been.called()
})

it('should receive pong', (done) => {
it('should have this private methods', () => {
expect(typeof lorena.processQueue).to.equal('function')
expect(typeof lorena.loop).to.equal('function')
})

it('should receive message:ping', (done) => {
const pingAction = {
recipe: 'ping', // Local name for your process
recipeId: 0,
Expand Down

0 comments on commit 9fd553a

Please sign in to comment.