util.js 354 B

12345678910111213141516
  1. 'use strict';
  2. const { setFlagsFromString } = require('v8');
  3. const { range } = require('../lib/util');
  4. // 984 by default.
  5. setFlagsFromString('--stack_size=500');
  6. test('should work', () => {
  7. const list = range(1, 3);
  8. expect(list).toEqual([1, 2, 3]);
  9. });
  10. test('should work for large ranges', () => {
  11. expect(() => range(1, 1e6)).not.toThrow();
  12. });