util.js 334 B

123456789101112131415
  1. import { setFlagsFromString } from 'v8'
  2. import { range } from '../lib/util'
  3. import test from 'ava'
  4. // 984 by default.
  5. setFlagsFromString('--stack_size=500')
  6. test('should work', (t) => {
  7. const list = range(1, 3)
  8. t.deepEqual(list, [1, 2, 3])
  9. })
  10. test('should work for large ranges', (t) => {
  11. t.notThrows(() => range(1, 1e6))
  12. })