forked from iDTech-Neha/iDTech_JavaScript_Coding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
19 lines (18 loc) · 715 Bytes
/
test.js
File metadata and controls
19 lines (18 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const Greet = require('./unit_test');
describe('Greet function', () =>{
it('should greet a single name', () => {
expect(Greet("Anthony")).toBe("Hello, Anthony");
});
it('should handle null values', () =>{
expect(Greet(null)).toBe("Hello there!");
});
it('should shout uppercase names', () => {
expect(Greet("BOB")).toBe("HELLO BOB!");
});
it('should greet two names', ()=>{
expect(Greet(["Tyler", "Neil"])).toBe("Hello, Tyler, Neil");
});
it('should greet multiple names', ()=> {
expect(Greet(["John", "Miles", "Thomas", "Anthony", "Tyler", "Neil"])).toBe("Hello, John, Miles, Thomas, Anthony, Tyler, Neil");
});
});