1
exercism fetch typescript nth-prime

nth-prime.test.ts

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import Prime from './nth-prime'

describe('Prime', () => {
  const prime = new Prime()

  it('first', () => {
    expect(prime.nth(1)).toEqual(2)
  })

  xit('second', () => {
    expect(prime.nth(2)).toEqual(3)
  })

  xit('sixth', () => {
    expect(prime.nth(6)).toEqual(13)
  })

  xit('big prime', () => {
    expect(prime.nth(10001)).toEqual(104743)
  })

  xit('weird case', () => {
    expect(() => prime.nth(0)).toThrowError('Prime is not possible')
  })
})