index.spec.ts 330 B

1234567891011121314
  1. import test from 'ava'
  2. import { sleep, sync } from '../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. })