Correcciones de documentacion y pruebas de funcionamiento
This commit is contained in:
18
LICENSE
Normal file
18
LICENSE
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2025 Drk0027
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||||
|
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
||||||
|
following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial
|
||||||
|
portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||||
|
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
||||||
|
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||||
|
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
55
README.md
Normal file
55
README.md
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# Word Clock Javascript
|
||||||
|
|
||||||
|
Este ejercicio didactico busca aprender a crear un modulo para nodejs y a utilizar la documentacion generada por JSDocs y los test Mocha.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 Tabla de Contenidos
|
||||||
|
- 🚀 Descripción
|
||||||
|
- ✨ Características
|
||||||
|
- ⚙️ Instalación
|
||||||
|
- 💡 Uso
|
||||||
|
- 🔧 Tecnologías
|
||||||
|
- 📄 Licencia
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 Descripción
|
||||||
|
Este coodigo pretende explicar como funcionan los modulos para nodejs y la implementacion de test de Mocha.
|
||||||
|
|
||||||
|
|
||||||
|
## ✨ Características
|
||||||
|
* Ejecucion en el terminal de NodeJS
|
||||||
|
* Cambio entre tres idiomas
|
||||||
|
* Documentacion mediante JSDocs
|
||||||
|
* Test mediante Mocha
|
||||||
|
|
||||||
|
## ⚙️ Instalación
|
||||||
|
1. Clona el repositorio:
|
||||||
|
```bash
|
||||||
|
git clone https://git.interlan.ec/Drk0027/Word-Clock-Javascript.git
|
||||||
|
```
|
||||||
|
2. Navega al directorio:
|
||||||
|
```bash
|
||||||
|
cd Word-Clock-Javascript
|
||||||
|
```
|
||||||
|
3. Instala las dependencias:
|
||||||
|
```bash
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
## 💡 Uso
|
||||||
|
**Ejemplo Básico:**
|
||||||
|
```bash
|
||||||
|
npm run run #Ejecuta en idioma inglés
|
||||||
|
npm run run_eo #Ejecuta en idioma esperanto
|
||||||
|
npm run run_es #Ejecuta en idioma español
|
||||||
|
npm run test #Ejecuta test mocha
|
||||||
|
```
|
||||||
|
|
||||||
|
# 🔧 Tecnologías Usadas
|
||||||
|
|
||||||
|
Lenguaje: JavaScript (Node.js)
|
||||||
|
|
||||||
|
# 📄 Licencia
|
||||||
|
Este proyecto está bajo la licencia MIT.
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
"terminal"
|
"terminal"
|
||||||
],
|
],
|
||||||
"author": "drk0027",
|
"author": "drk0027",
|
||||||
"license": "ISC",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chai": "^4.3.4",
|
"chai": "^4.3.4",
|
||||||
"chalk": "^4.1.1"
|
"chalk": "^4.1.1"
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
var assert = require("chai").assert;
|
var assert = require("chai").assert;
|
||||||
var expect = require("chai").expect;
|
|
||||||
var should = require("chai").should();
|
|
||||||
|
|
||||||
|
|
||||||
var inicio = require("../index");
|
var inicio = require("../index");
|
||||||
|
|
||||||
@@ -11,7 +8,11 @@ describe("WordClock evaluado utilizando la interfaz Assert del modulo CHAI", fun
|
|||||||
result = inicio.cambiar_idioma("es")
|
result = inicio.cambiar_idioma("es")
|
||||||
assert.equal(result, "es")
|
assert.equal(result, "es")
|
||||||
})
|
})
|
||||||
it("Comprobar que el idioma seleccionado retorne el idioma predeterminado",function(){
|
it("Comprobar que el idioma esperado coincida con el seleccionado", function () {
|
||||||
|
result = inicio.cambiar_idioma("eo")
|
||||||
|
assert.equal(result, "eo")
|
||||||
|
})
|
||||||
|
it("Comprobar que el idioma seleccionado al ser desconocido retorne el idioma predeterminado", function () {
|
||||||
result = inicio.cambiar_idioma("ep")
|
result = inicio.cambiar_idioma("ep")
|
||||||
assert.equal(result, "en")
|
assert.equal(result, "en")
|
||||||
})
|
})
|
||||||
@@ -19,46 +20,3 @@ describe("WordClock evaluado utilizando la interfaz Assert del modulo CHAI", fun
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
describe("WordClock evaluado utilizando la interfaz Assert del modulo CHAI", function () {
|
|
||||||
describe("revisar que el idioma sea cambiado con exito",function(){
|
|
||||||
it("Comprobar que el idioma esperado coincida con el seleccionado",function(){
|
|
||||||
result= inicio.cambiar_idioma("es")
|
|
||||||
assert.equal(result,"es")
|
|
||||||
})
|
|
||||||
it("Comprobar que el idioma seleccionado retorne el idioma predeterminado",function(){
|
|
||||||
result= inicio.cambiar_idioma("ep")
|
|
||||||
assert.equal(result,"error")
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("WordClock evaluado utilizando la interfaz EXPECT del modulo CHAI",function(){
|
|
||||||
describe("Revisar funcion cambiar_idioma",function(){
|
|
||||||
it("revisar el valor de retorno esperado usando expect(value).to.equal('value')",function(){
|
|
||||||
result=inicio.cambiar_idioma("es")
|
|
||||||
expect(result).to.equal("es")
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
describe("Calcultator tests using SHOULD interface from CHAI module: ", function () {
|
|
||||||
describe("Check addTested Function: ", function () {
|
|
||||||
it("Check the returned value using: value.should.equal(value): ", function () {
|
|
||||||
result = calculator.addTested("text");
|
|
||||||
result.should.equal("text tested");
|
|
||||||
});
|
|
||||||
it("Check the returned value using: value.should.be.a('value'): ", function () {
|
|
||||||
result = calculator.addTested("text");
|
|
||||||
result.should.be.a('string');
|
|
||||||
});
|
|
||||||
it("Check the returned value using: expect(value).to.have.lengthOf(value): ", function () {
|
|
||||||
result = calculator.addTested("text");
|
|
||||||
result.should.have.lengthOf(11);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
Reference in New Issue
Block a user