Sha256: 8157ad54974a0142c23a41f1453d75e550d05219084fb513fb9e80dd25a23c49

Contents?: true

Size: 1008 Bytes

Versions: 68

Compression:

Stored size: 1008 Bytes

Contents

import CollatzConjecture from './collatz-conjecture'

describe('CollatzConjecture', () => {
    it('zero steps for one', () => {
        const expected = 0
        expect(CollatzConjecture.steps(1)).toBe(expected)
    })

    xit('divide if even', () => {
        const expected = 4
        expect(CollatzConjecture.steps(16)).toBe(expected)
    })

    xit('even and odd steps', () => {
        const expected = 9
        expect(CollatzConjecture.steps(12)).toBe(expected)
    })

    xit('Large number of even and odd steps', () => {
        const expected = 152
        expect(CollatzConjecture.steps(1000000)).toBe(expected)
    })

    xit('zero is an error', () => {
        const expected = 'Only positive numbers are allowed'
        expect(() => {CollatzConjecture.steps(0)}).toThrowError(expected)
    })

    xit('negative value is an error', () => {
        const expected = 'Only positive numbers are allowed'
        expect(() => {CollatzConjecture.steps(-15)}).toThrowError(expected)
    })
})

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.138 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.137 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.136 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.135 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.134 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.133 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.132 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.131 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.130 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.129 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.128 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.127 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.126 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.125 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.124 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.123 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.122 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.121 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts
trackler-2.2.1.120 tracks/typescript/exercises/collatz-conjecture/collatz-conjecture.test.ts