Skip to content

Commit

Permalink
public API tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshuawuyts committed Mar 13, 2018
1 parent 1c8ccc8 commit c1f621d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,19 @@ tape('should render on the server with hyperscript', function (t) {
t.equal(res.toString().trim(), exp, 'result was OK')
t.end()
})

tape('should expose a public API', function (t) {
var app = choo()

t.equal(typeof app.route, 'function', 'app.route prototype method exists')
t.equal(typeof app.toString, 'function', 'app.toString prototype method exists')
t.equal(typeof app.start, 'function', 'app.start prototype method exists')
t.equal(typeof app.mount, 'function', 'app.mount prototype method exists')
t.equal(typeof app.emitter, 'object', 'app.emitter prototype method exists')

t.equal(typeof app.emit, 'function', 'app.emit instance method exists')
t.equal(typeof app.router, 'object', 'app.router instance object exists')
t.equal(typeof app.state, 'object', 'app.state instance object exists')

t.end()
})

0 comments on commit c1f621d

Please sign in to comment.