Skip to content

Instantly share code, notes, and snippets.

@ababup1192
Last active February 12, 2019 23:17
Show Gist options
  • Select an option

  • Save ababup1192/6c1e7453e595b816e044ca4de00a0985 to your computer and use it in GitHub Desktop.

Select an option

Save ababup1192/6c1e7453e595b816e044ca4de00a0985 to your computer and use it in GitHub Desktop.
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();
});
});
});
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