Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Add simple unit tests for Router
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmed committed Feb 11, 2018
1 parent ba8436c commit 2170736
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/router.test.js
@@ -0,0 +1,15 @@
import { h, renderToString } from 'ink'
import Router from './router'

describe('<Router />', () => {
describe('with default props', () => {
it('should render without throwing an error', () => {
expect(() => renderToString(<Router>Hey</Router>)).not.toThrow()
})

it('should render the one child passed to it', () => {
const actual = renderToString(<Router>Hey</Router>)
expect(actual).toEqual('Hey')
})
})
})

0 comments on commit 2170736

Please sign in to comment.