Initial commit

This commit is contained in:
Jay
2020-08-14 16:11:58 +08:00
commit ad2ba7b3da
23 changed files with 3266 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
const test = require('ava')
const { sleep, sync } = require('../index')
test('sync function from native code', (t) => {
const fixture = 42
t.is(sync(fixture), fixture + 100)
})
test('sleep function from native code', async (t) => {
const timeToSleep = 200
const value = await sleep(timeToSleep)
t.is(value, timeToSleep * 2)
})