// Import AVA
import test from 'ava'

// Imports
import sleep from '../../src/util/sleep'

/**
 * Sleep 10 milliseconds.
 */
test('sleep 10 milliseconds', async t => {
  await t.notThrows(async () => {
    await sleep(10)
  })
})

/**
 * Sleep default time.
 */
test('sleep default time', async t => {
  await t.notThrows(async () => {
    await sleep()
  })
})

/**
 * Time must be number.
 */
test('time must be number', async t => {
  const prom = sleep('test')
  await t.throws(prom)
})

/**
 * Time must be integer.
 */
test('time must be integer', async t => {
  const prom = sleep(7.4)
  await t.throws(prom)
})

@@ -167,63 +167,55 @@
 %7B%0A  
-await t.notThrows(async () =%3E %7B%0A    await sleep(10)%0A  %7D
+const prom = sleep(10)%0A  await t.notThrows(prom
 )%0A%7D)
@@ -293,61 +293,53 @@
 %7B%0A  
-await t.notThrows(async () =%3E %7B%0A    await sleep()%0A  %7D
+const prom = sleep()%0A  await t.notThrows(prom
 )%0A%7D)

Correct successful sleep tests