test.js 415 B

1234567891011121314151617
  1. var test = require('tape')
  2. var hasObjectSpread = require('./')
  3. var skip = hasObjectSpread()
  4. function trySpread () { Function('({ ...x })') }
  5. test('has object spread', { skip: !skip }, function (t) {
  6. t.doesNotThrow(trySpread)
  7. t.equal(hasObjectSpread(), true)
  8. t.end()
  9. })
  10. test('does not have object spread', { skip: skip }, function (t) {
  11. t.throws(trySpread)
  12. t.equal(hasObjectSpread(), false)
  13. t.end()
  14. })