index.spec.js 340 B

1234567891011121314
  1. const test = require('ava')
  2. const { sleep, sync } = require('../index')
  3. test('sync function from native code', (t) => {
  4. const fixture = 42
  5. t.is(sync(fixture), fixture + 100)
  6. })
  7. test('sleep function from native code', async (t) => {
  8. const timeToSleep = 200
  9. const value = await sleep(timeToSleep)
  10. t.is(value, timeToSleep * 2)
  11. })