-
Notifications
You must be signed in to change notification settings - Fork 0
/
12.spec.ts
69 lines (56 loc) · 2.1 KB
/
12.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { test, assertType, expect, describe } from 'vitest'
import { checkIsValidCopy } from '../challenges/12'
describe('Challenge #12', () => {
test('Test #01', () => {
const answer = checkIsValidCopy('', '')
assertType<boolean>(answer)
})
test('Test #02', () => {
const received = checkIsValidCopy('Santa Claus is coming', 'sa#ta cl#us is comin#')
expect(received).toEqual(true)
})
test('Test #03', () => {
const received = checkIsValidCopy('Santa Claus is coming', 'p#nt: cla#s #s c+min#')
expect(received).toEqual(false)
})
test('Test #04', () => {
const received = checkIsValidCopy('Santa Claus', ' Santa Claus ')
expect(received).toEqual(false)
})
test('Test #05', () => {
const received = checkIsValidCopy('Santa Claus', '###:. c:+##')
expect(received).toEqual(true)
})
test('Test #06', () => {
const received = checkIsValidCopy('Santa Claus', 'sant##claus+')
expect(received).toEqual(false)
})
test('Test #07', () => {
const received = checkIsValidCopy('Santa Claus', 's#+:. c:. s')
expect(received).toEqual(true)
})
test('Test #08', () => {
const received = checkIsValidCopy('Santa Claus', 's#+:.#c:. s')
expect(received).toEqual(false)
})
test('Test #09', () => {
const received = checkIsValidCopy('Santa Claus', 'SantA ClauS')
expect(received).toEqual(false)
})
test('Test #10', () => {
const received = checkIsValidCopy('3 #egalos', '3 .+:# #:')
expect(received).toEqual(true)
})
test('Test #11', () => {
const received = checkIsValidCopy('3 regalos', '3 ')
expect(received).toEqual(true)
})
test('Test #12', () => {
const received = checkIsValidCopy('3 regalos 3', '3 .+:# #: 3')
expect(received).toEqual(true)
})
test('Test #13', () => {
const received = checkIsValidCopy('Santa Claus viene a buscarte para darte muchos regalos y eso es espectacular porque da mucha felicidad a todos los niños', 'Santa Claus viene a buscarte para darte muchos regalos y eso es espectacular porque da mucha felicidad a todos los niño')
expect(received).toEqual(false)
})
})