Last active
February 12, 2019 23:17
-
-
Save ababup1192/6c1e7453e595b816e044ca4de00a0985 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import * as index from '../index'; | |
| describe('Tests', () => { | |
| describe('isMan /* index.tsで書いた関数名 */', () => { | |
| it('manなら男' /* 渡した文字列はmanですか? という質問が正しいなら男 */, () => { | |
| expect(index.isMan('man' /* sex = 'man' */)).toBeTruthy(); | |
| }); | |
| it('womanなら男ではない' /* 渡した文字列はmanですか? という質問が正しくないなら男ではない*/, () => { | |
| expect(index.isMan('woman')).toBeFalsy(); | |
| }); | |
| }); | |
| }); |
This file contains hidden or 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
| export const isMan = (sex: string /* ここに 'man' や 'woman' など性別に関する文字列が入る */): boolean /* trueなら男 falseなら男ではない */ => { | |
| return sex === 'man'; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment