| 85 | }); |
| 86 | it('should throw an exception if generator.length is invalid', function () { |
| 87 | const length = x => Object.defineProperty(function*(){}, 'length', { value: x }); |
| 88 | expect(() => this.db.table('a', { columns: ['x'], rows: length(undefined) })).to.throw(TypeError); |
| 89 | expect(() => this.db.table('b', { columns: ['x'], rows: length(null) })).to.throw(TypeError); |
| 90 | expect(() => this.db.table('c', { columns: ['x'], rows: length('1') })).to.throw(TypeError); |