Skip to content

Commit

Permalink
Reto mouredev#26 - Javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
Cesar-Ch committed Jul 19, 2023
1 parent 90c58d8 commit 8cbd68d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Retos/Reto #26 - TESTING [Media]/javascript/cesar-ch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* 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).
*/

import { describe, expect, it, } from "vitest";

function itsFridayThirteenth(month, year) {
return new Date(`${month} 13, ${year}`).getDay() === 5
}



describe('itsFridayThirteenth', () => {
it('should return true for friday the 13th', () => {
expect(itsFridayThirteenth('January', 2023)).toBe(true)
})

it('should return false for friday the 13th', () => {
expect(itsFridayThirteenth('May', 2022)).toBe(true)
})

it('should return false for friday the 13th', () => {
expect(itsFridayThirteenth('July', 2023)).toBe(false)
})
})

0 comments on commit 8cbd68d

Please sign in to comment.