Get the name of a number, even if it's stupidly big.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
このリポジトリはアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュや、課題・プルリクエストのオープンはできません。

29 行
699 B

  1. import tenTimes from './tenTimes'
  2. it('should exist', () => {
  3. expect(tenTimes).toBeDefined()
  4. })
  5. it('should be a callable', () => {
  6. expect(typeof tenTimes).toBe('function')
  7. })
  8. it('should accept 1 argument', () => {
  9. expect(tenTimes).toHaveLength(1)
  10. })
  11. test.each`
  12. value | display | name
  13. ${1} | ${'10'} | ${'sampu'}
  14. ${2} | ${'20'} | ${'dalawampu'}
  15. ${3} | ${'30'} | ${'tatlumpu'}
  16. ${4} | ${'40'} | ${'apatnapu'}
  17. ${5} | ${'50'} | ${'limampu'}
  18. ${6} | ${'60'} | ${'animnapu'}
  19. ${7} | ${'70'} | ${'pitumpu'}
  20. ${8} | ${'80'} | ${'walumpu'}
  21. ${9} | ${'90'} | ${'siyamnapu'}
  22. `('should return "$name" on $display', ({ value, name }) => {
  23. expect(tenTimes(value)).toBe(name)
  24. })