Get the name of a number, even if it's stupidly big.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Deze repo is gearchiveerd. U kunt bestanden bekijken en het klonen, maar niet pushen of problemen/pull-requests openen.

30 regels
721 B

  1. import tenPlus from './tenPlus'
  2. it('should exist', () => {
  3. expect(tenPlus).toBeDefined()
  4. })
  5. it('should be a callable', () => {
  6. expect(typeof tenPlus).toBe('function')
  7. })
  8. it('should accept 1 argument', () => {
  9. expect(tenPlus).toHaveLength(1)
  10. })
  11. test.each`
  12. value | display | name
  13. ${0} | ${'10'} | ${'zehn'}
  14. ${1} | ${'11'} | ${'elf'}
  15. ${2} | ${'12'} | ${'zwölf'}
  16. ${3} | ${'13'} | ${'dreizehn'}
  17. ${4} | ${'14'} | ${'vierzehn'}
  18. ${5} | ${'15'} | ${'fünfzehn'}
  19. ${6} | ${'16'} | ${'sechzehn'}
  20. ${7} | ${'17'} | ${'siebzehn'}
  21. ${8} | ${'18'} | ${'achtzehn'}
  22. ${9} | ${'19'} | ${'neunzehn'}
  23. `('should return "$name" on $display', ({ value, name }) => {
  24. expect(tenPlus(value)).toBe(name)
  25. })