Primer commit. Coodigo escrito en el añoo 2021
This commit is contained in:
64
test/wordclock_test.js
Executable file
64
test/wordclock_test.js
Executable file
@@ -0,0 +1,64 @@
|
||||
var assert = require("chai").assert;
|
||||
var expect = require("chai").expect;
|
||||
var should = require("chai").should();
|
||||
|
||||
|
||||
var inicio = require("../index");
|
||||
|
||||
describe("WordClock evaluado utilizando la interfaz Assert del modulo CHAI", function () {
|
||||
describe("Comprobar 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,"en")
|
||||
})
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
|
||||
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