Skip to content

Commit

Permalink
Add basic test (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerLH committed Oct 25, 2017
1 parent 005aadf commit 804419a
Show file tree
Hide file tree
Showing 5 changed files with 8,897 additions and 58 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["react-native"]
}
16 changes: 16 additions & 0 deletions __tests__/TimeAgo.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react'
import { Text } from 'react-native'
import renderer from 'react-test-renderer'
import moment from 'moment'
import TimeAgo from '../TimeAgo'

describe('TimeAgo', () => {
test('Renders', () => {
const timestamp = moment().subtract(10, 'days')
const component = renderer.create(
<TimeAgo time={timestamp} />
)
const instance = component.root
expect(instance.findByType(Text).props.children).toEqual('10 days ago')
})
})
Loading

0 comments on commit 804419a

Please sign in to comment.