Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(lib/string): Add test for makeName #22 #24

Merged
merged 3 commits into from
Nov 30, 2017
Merged

test(lib/string): Add test for makeName #22 #24

merged 3 commits into from
Nov 30, 2017

Conversation

dmitryshelomanov
Copy link
Member

@dmitryshelomanov dmitryshelomanov commented Nov 30, 2017

Первый тест. Для makeName

@dmitryshelomanov dmitryshelomanov changed the title test(lib/string): Add test from makeName test(lib/string): Add test from makeName # Nov 30, 2017
@dmitryshelomanov dmitryshelomanov changed the title test(lib/string): Add test from makeName # test(lib/string): Add test from makeName #22 Nov 30, 2017
first_name: faker.name.firstName(),
last_name: faker.name.lastName(),
}
const name = makeName(user)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я бы переименовал в getUserFullname

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, так будет лучше. Но всё таки это лучше делать отдельным ПР

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sergeysova да, конечно, просто обратил внимание

}
const name = makeName(user)

t.true(/[a-z]/ig.test(name))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет. Тут должна быть проверка, что функция вернула не просто набор неких символов. А именно имя и фамилию.

}
const name = makeName(user)

t.true(/[a-z]/ig.test(name))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Как и здесь. Поможет метод t.is(a, b)

@sergeysova sergeysova changed the title test(lib/string): Add test from makeName #22 test(lib/string): Add test for makeName #22 Nov 30, 2017
@dmitryshelomanov
Copy link
Member Author

Обосрали (
А как мне проверить что именно А и Б? Задать свои переменные и в ходе проверить что результат === переменным ?
@sergeysova

@sergeysova
Copy link
Member

@userbq201

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

Это не очевидно разве?

@sergeysova sergeysova closed this Nov 30, 2017
@sergeysova sergeysova deleted the string_test branch November 30, 2017 21:00
@sergeysova sergeysova restored the string_test branch November 30, 2017 21:01
@sergeysova sergeysova reopened this Nov 30, 2017
@sergeysova sergeysova merged commit ffb40b0 into dev Nov 30, 2017
@sergeysova sergeysova deleted the string_test branch November 30, 2017 21:20
sergeysova pushed a commit that referenced this pull request Nov 30, 2017
* test(lib/string): Add test from makeName

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

* test(lib/string): Refactor test

#22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants