-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: alumag <10659903+alumag@users.noreply.github.com>
- Loading branch information
Showing
19 changed files
with
2,697 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
const { getFirstName, getLastName, getFullName } = require('.'); | ||
|
||
describe('test hebrew-names', () => { | ||
describe('getFirstName', () => { | ||
test.each([ | ||
['christian', 'male', 'אליאס'], | ||
['christian', 'female', 'מריה'], | ||
['druze', 'male', 'סולימאן'], | ||
['druze', 'female', 'נור'], | ||
['jew', 'male', 'דוד'], | ||
['jew', 'female', 'נועה'], | ||
['muslim', 'male', 'מוחמד'], | ||
['muslim', 'female', 'פאטמה'], | ||
['other', 'male', 'דניאל'], | ||
['other', 'female', 'ניקול'], | ||
])('should get random first name for ethnicity=%s and gender=%s', (ethnicity, gender, expectedName) => { | ||
expect(getFirstName(ethnicity, gender)).toMatch(expectedName); | ||
}); | ||
|
||
test('should get random first name', () => { | ||
expect(getFirstName()).toStrictEqual(expect.any(String)); | ||
}); | ||
|
||
test('should throw an error with unsupported gender', () => { | ||
expect(() => getFirstName(undefined, 'unknown')).toThrow(TypeError); | ||
}); | ||
|
||
test('should throw an error with unsupported ethnicity', () => { | ||
expect(() => getFirstName('unknown', undefined)).toThrow(TypeError); | ||
}); | ||
}); | ||
|
||
describe('getLastName', () => { | ||
test.each([ | ||
['christian', "ח'ורי"], | ||
['druze', 'חלבי'], | ||
['jew', 'כהן'], | ||
['muslim', 'אגבאריה'], | ||
['other', ''], | ||
])('should get random last name for ethnicity=%s', (ethnicity, expectedName) => { | ||
expect(getLastName(ethnicity)).toMatch(expectedName); | ||
}); | ||
|
||
test('should get random last name', () => { | ||
expect(getLastName()).toStrictEqual(expect.any(String)); | ||
}); | ||
|
||
|
||
test('should throw an error with unsupported ethnicity', () => { | ||
expect(() => getLastName('unknown')).toThrow(TypeError); | ||
}); | ||
}); | ||
|
||
describe('getFullName', () => { | ||
test('should get random full name', () => { | ||
expect(getFullName()).toStrictEqual(expect.any(String)); | ||
}); | ||
|
||
test('should throw an error with unsupported gender', () => { | ||
expect(() => getFullName(undefined, 'unknown')).toThrow(TypeError); | ||
}); | ||
|
||
test('should throw an error with unsupported ethnicity', () => { | ||
expect(() => getFullName('unknown', undefined)).toThrow(TypeError); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.