From 96b8a7626c94103573ccc29a196404dec744c22f Mon Sep 17 00:00:00 2001 From: Leifer Mendez Date: Sat, 29 Oct 2022 14:47:42 +0200 Subject: [PATCH] uvu test:io --- packages/DRAFT.md | 0 packages/io/{TODO.md => USES_CASES.md} | 13 +++++++++++- packages/io/package.json | 1 + packages/io/tests/methods.test.js | 29 +++++++++++++++++++------- 4 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 packages/DRAFT.md rename packages/io/{TODO.md => USES_CASES.md} (87%) diff --git a/packages/DRAFT.md b/packages/DRAFT.md new file mode 100644 index 0000000..e69de29 diff --git a/packages/io/TODO.md b/packages/io/USES_CASES.md similarity index 87% rename from packages/io/TODO.md rename to packages/io/USES_CASES.md index a281ea5..ac10ec3 100644 --- a/packages/io/TODO.md +++ b/packages/io/USES_CASES.md @@ -12,7 +12,9 @@ - [x] addAnswer - [ ] addKeyword: Opciones - [ ] addAnswer: Opciones -- [ ] Si ha contactado previamente. Seguir continuida +- [ ] Retornar SQL +- [ ] Retornar JSON +- [ ] Recibir JSON ```js // bootstrap.js Como iniciar el provider @@ -98,3 +100,12 @@ answerOne.push(otherAnswer) inout.addKeywords(['hola', 'hi', 'ola']) ``` + +**Comunidad** + +> Forma parte de este proyecto. + +- [Discord](https://link.codigoencasa.com/DISCORD) +- [Twitter](https://twitter.com/leifermendez) +- [Youtube](https://www.youtube.com/watch?v=5lEMCeWEJ8o&list=PL_WGMLcL4jzWPhdhcUyhbFU6bC0oJd2BR) +- [Telegram](https://t.me/leifermendez) diff --git a/packages/io/package.json b/packages/io/package.json index 75a3ff6..5848618 100644 --- a/packages/io/package.json +++ b/packages/io/package.json @@ -11,6 +11,7 @@ "format:write": "prettier --write .", "lint:check": "eslint .", "lint:fix": "eslint --fix .", + "test:io": "node ../../node_modules/uvu/bin.js tests", "build:io": "npm run format:write && npm run lint:fix && npm run io:rollup" }, "keywords": [], diff --git a/packages/io/tests/methods.test.js b/packages/io/tests/methods.test.js index b943c2b..4599f40 100644 --- a/packages/io/tests/methods.test.js +++ b/packages/io/tests/methods.test.js @@ -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()