Skip to content

Commit

Permalink
#add test case for attaching IO instances
Browse files Browse the repository at this point in the history
  • Loading branch information
mattstyles committed Jan 18, 2016
1 parent 592c6e3 commit fe4c704
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/attach.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ tape( 'Attaching a namespace should be done via an options object', t => {
}, null, 'Attaching only a namespace via options hash is fine' )
})

tape( 'Attaching a namespace will attach the IO class', t => {
t.plan( 2 )

const app = new Koa()
const chat = new IO( 'chat' )

chat.attach( app )
t.ok( app.chat, 'the chat namespace has been attached to the app' )
t.ok( app.chat instanceof IO, 'an IO instance has been attached' )
})

tape( 'Namespaces can be hidden from the app object', t => {
t.plan( 2 )

Expand Down

0 comments on commit fe4c704

Please sign in to comment.