newlangpbl
Version:
Traductor de idioma platzoom
24 lines (22 loc) • 983 B
JavaScript
const expect = require('chai').expect
const newlangpbl = require('..').default
describe('#newlangpbl', function () {
it('si la palabra termina en "ar", se le quitan esos dos caracteres', function () {
const translation = newlangpbl("Programar")
expect(translation).to.equal("Program")
})
it('si la palabra inicia con Z, se le añade "pe" al final', function () {
const translation = newlangpbl('zorro')
expect(translation).to.equal("zorrope")
const translation2 = newlangpbl('zarpar')
expect(translation2).to.equal("zarppe")
})
it('si la palabra traducida tiene 10 o mas letras, se debe dividir en 2 partes iguales y unir con un guión', function () {
const translation = newlangpbl('abecedario')
expect(translation).to.equal("abece-dario")
})
it('si la palabra original es un palíndromo, ninguna regla anterior se aplica', function () {
const translation = newlangpbl('sometemos')
expect(translation).to.equal("SoMeTeMoS")
})
})