choo components (#639)
* add components * example: componentize header * fix choo SSR * example: componentize footer * example: fix footer * update component cache asserts * componentize todos * reorder example dir * fix example tests * fix dep check test * Add garbage collection of unused components * Apply args when calling identity * update to new component preview * update nanocomponent * fix cache err name * remove static methods from example * restore app.emit() function * public API tests * offset component cache iteration by 2 * whitelist contents of component folder (#643) * allow lru number arg * fix lint typo
This commit is contained in:
@@ -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()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user