Skip to content

Commit db3f1d0

Browse files
second test
1 parent 86f3e17 commit db3f1d0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

util.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
exports.generateText = (name, age) => {
22
// Returns output text
33
return `${name} (${age} years old)`;
4+
// return 'Max (29 years old)';
45
};
56

67
exports.createElement = (type, text, className) => {

util.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ test('should output name and age', () => {
44
const text = generateText('Max', 29);
55
expect(text).toBe('Max (29 years old)');
66
});
7+
8+
test('should output data-less text', () => {
9+
const text = generateText('', null);
10+
expect(text).toBe(' (null years old)');
11+
});

0 commit comments

Comments
 (0)