Skip to content

Commit

Permalink
test(lib/string): Add test for makeName #22 (#24)
Browse files Browse the repository at this point in the history
* test(lib/string): Add test from makeName

* test: Add travis and codecov (#25) #22

* test(lib/string): Refactor test

#22
  • Loading branch information
Shelomanov Dmitry authored and sergeysova committed Nov 30, 2017
1 parent eef60cf commit bdb3111
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/lib/string.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import test from 'ava'
import faker from 'faker'
import { makeName } from './string'

/* eslint-disable no-magic-numbers */

test('testing string with last_name', (t) => {
const user = {
first_name: faker.name.firstName(),
last_name: faker.name.lastName(),
}

t.is(makeName(user), `${user.first_name} ${user.last_name}`)
})

test('testing string without last_name', (t) => {
const user = {
first_name: faker.name.firstName(),
}

t.is(makeName(user), `${user.first_name}`)
})

0 comments on commit bdb3111

Please sign in to comment.