Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reto #26 - Javascript #3984

Merged
merged 1 commit into from
Jul 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions Retos/Reto #26 - TESTING [Media]/javascript/marcode24.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Crea tres test sobre el reto 12: "Viernes 13".
* - Puedes copiar una solución ya creada por otro usuario en
* el lenguaje que estés utilizando.
* - Debes emplear un mecanismo de ejecución de test que posea
* el lenguaje de programación que hayas seleccionado.
* - Los tres test deben de funcionar y comprobar
* diferentes situaciones (a tu elección).
*/

// Visita mi repo en GitHub para ver y correr los tests de este código --> https://github.com/marcode24/weekly-challenges

const includesFriday13 = require('../12-viernes-13/solution');

describe('Challenge 12: Viernes 13', () => {
const testCases = [
{
input: [2, 2016],
output: false,
},
{
input: [4, 1990],
output: true,
},
{
input: [7, 1990],
output: true,
},
{
input: [11, 2009],
output: true,
},
{
input: [8, 2010],
output: true,
},
{
input: [5, 2011],
output: true,
},
{
input: [1, 1985],
output: false,
},
{
input: [8, 2021],
output: true,
},
{
input: [1, 2023],
output: true,
},
{
input: [10, 2023],
output: true,
},
];

it('should return a boolean type', () => {
expect(typeof includesFriday13(1, 2023)).toBe('boolean');
});

it.each(testCases)('should return $output', (testCase) => {
expect(includesFriday13(...testCase.input)).toBe(testCase.output);
});
});

// Visita mi repo en GitHub para ver y correr los tests de este código --> https://github.com/marcode24/weekly-challenges