uvu test:io

This commit is contained in:
Leifer Mendez
2022-10-29 14:47:42 +02:00
parent 7593d6e564
commit 96b8a7626c
4 changed files with 34 additions and 9 deletions

View File

@@ -1,12 +1,25 @@
const { test, suite } = require('uvu')
const { snapshot } = require('uvu/assert')
const botTest = suite('bot-function')
test(``, async () => {
const { snapshot, is } = require('uvu/assert')
test('sum', () => {
assert.type(math.sum, 'function')
assert.is(math.sum(1, 2), 3)
assert.is(math.sum(-1, -2), -3)
assert.is(math.sum(-1, 1), 0)
})
botTest.run()
test('div', () => {
assert.type(math.div, 'function')
assert.is(math.div(1, 2), 0.5)
assert.is(math.div(-1, -2), 0.5)
assert.is(math.div(-1, 1), -1)
})
test('mod', () => {
assert.type(math.mod, 'function')
assert.is(math.mod(1, 2), 1)
assert.is(math.mod(-3, -2), -1)
assert.is(math.mod(7, 4), 3)
})
test.run()