FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
aRustyDev/data/validate.test.ts at main · aRustyDev/aRustyDev · GitHub
aRustyDev
/
aRustyDev
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
31
Pull requests
10
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
aRustyDev
/
data
/
validate.test.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
92 lines (86 loc) · 2.5 KB
Breadcrumbs
aRustyDev
/
data
/
validate.test.ts
Copy path
File metadata and controls
92 lines (86 loc) · 2.5 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import
{
describe
,
it
,
expect
}
from
"vitest"
;
import
{
validateCV
,
validateProfile
}
from
"./validate.js"
;
describe
(
"validateCV"
,
(
)
=>
{
it
(
"accepts valid CV data"
,
(
)
=>
{
const
cv
=
{
personal
:
{
name
:
"Test"
,
email
:
"t@t.com"
,
phone
:
"555"
,
location
:
"Remote"
,
links
:
{
github
:
""
,
linkedin
:
""
,
website
:
""
,
blog
:
""
}
,
}
,
experience
:
[
{
id
:
"a"
,
company
:
"C"
,
title
:
"T"
,
location
:
"L"
,
start
:
"2023-01"
,
end
:
null
,
highlights
:
[
]
,
}
,
]
,
education
:
[
]
,
skills
:
[
]
,
projects
:
[
]
,
certifications
:
[
]
,
}
;
expect
(
(
)
=>
validateCV
(
cv
)
)
.
not
.
toThrow
(
)
;
}
)
;
it
(
"rejects CV with duplicate IDs in a collection"
,
(
)
=>
{
const
cv
=
{
personal
:
{
name
:
"Test"
,
email
:
"t@t.com"
,
phone
:
"555"
,
location
:
"Remote"
,
links
:
{
github
:
""
,
linkedin
:
""
,
website
:
""
,
blog
:
""
}
,
}
,
experience
:
[
{
id
:
"dup"
,
company
:
"A"
,
title
:
"T"
,
location
:
"L"
,
start
:
"2023"
,
end
:
null
,
highlights
:
[
]
}
,
{
id
:
"dup"
,
company
:
"B"
,
title
:
"T"
,
location
:
"L"
,
start
:
"2022"
,
end
:
null
,
highlights
:
[
]
}
,
]
,
education
:
[
]
,
skills
:
[
]
,
projects
:
[
]
,
certifications
:
[
]
,
}
;
expect
(
(
)
=>
validateCV
(
cv
)
)
.
toThrow
(
/
d
u
p
l
i
c
a
t
e
.
*
i
d
.
*
"
d
u
p
"
.
*
e
x
p
e
r
i
e
n
c
e
/
i
)
;
}
)
;
it
(
"rejects CV missing required fields"
,
(
)
=>
{
expect
(
(
)
=>
validateCV
(
{
personal
:
{
name
:
"Test"
}
}
as
any
)
)
.
toThrow
(
)
;
}
)
;
}
)
;
describe
(
"validateProfile"
,
(
)
=>
{
it
(
"accepts valid profile"
,
(
)
=>
{
const
profile
=
{
slug
:
"test"
,
title
:
"Test"
,
include
:
{
experience
:
[
"a"
]
,
education
:
[
]
,
skills
:
[
]
,
projects
:
[
]
,
certifications
:
[
]
,
}
,
}
;
expect
(
(
)
=>
validateProfile
(
profile
)
)
.
not
.
toThrow
(
)
;
}
)
;
it
(
"rejects profile missing slug"
,
(
)
=>
{
const
profile
=
{
title
:
"Test"
,
include
:
{
experience
:
[
]
,
education
:
[
]
,
skills
:
[
]
,
projects
:
[
]
,
certifications
:
[
]
}
,
}
;
expect
(
(
)
=>
validateProfile
(
profile
as
any
)
)
.
toThrow
(
/
s
l
u
g
/
i
)
;
}
)
;
it
(
"rejects profile with invalid override path format"
,
(
)
=>
{
const
profile
=
{
slug
:
"test"
,
title
:
"Test"
,
include
:
{
experience
:
[
]
,
education
:
[
]
,
skills
:
[
]
,
projects
:
[
]
,
certifications
:
[
]
}
,
overrides
:
{
"bad.path"
:
"value"
}
,
}
;
expect
(
(
)
=>
validateProfile
(
profile
)
)
.
toThrow
(
/
o
v
e
r
r
i
d
e
p
a
t
h
/
i
)
;
}
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL