Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drip
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
backup
Drip
Commits
e1d63454
Commit
e1d63454
authored
6 years ago
by
emelko
Browse files
Options
Downloads
Patches
Plain Diff
Removing comment & making error comments even more helpful
parent
9f5eb7c3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/sympto/index.js
+12
-12
12 additions, 12 deletions
lib/sympto/index.js
with
12 additions
and
12 deletions
lib/sympto/index.js
+
12
−
12
View file @
e1d63454
...
@@ -104,21 +104,21 @@ export default function getSymptoThermalStatus(cycleInfo) {
...
@@ -104,21 +104,21 @@ export default function getSymptoThermalStatus(cycleInfo) {
function
throwIfArgsAreNotInRequiredFormat
(
cycles
)
{
function
throwIfArgsAreNotInRequiredFormat
(
cycles
)
{
cycles
.
forEach
(
cycle
=>
{
cycles
.
forEach
(
cycle
=>
{
assert
.
ok
(
Array
.
isArray
(
cycle
),
"
Cycles must be arrays.
"
)
assert
.
ok
(
Array
.
isArray
(
cycle
),
"
Cycles must be arrays.
"
)
assert
.
ok
(
cycle
.
length
>
0
,
"
Cycle must not be empty.
"
)
//what about 2 cycles of 1 day each?!
assert
.
ok
(
cycle
.
length
>
0
,
"
Cycle must not be empty.
"
)
assert
.
ok
(
cycle
[
0
].
bleeding
!==
null
,
"
First cycle day should have bleeding.
"
)
assert
.
ok
(
cycle
[
0
].
bleeding
!==
null
,
"
First cycle day should have bleeding.
"
)
assert
.
equal
(
typeof
cycle
[
0
].
bleeding
,
'
object
'
,
"
First cycle day must contain bleeding value.
"
)
assert
.
equal
(
typeof
cycle
[
0
].
bleeding
,
'
object
'
,
"
First cycle day must contain bleeding value.
"
)
assert
.
equal
(
typeof
cycle
[
0
].
bleeding
.
value
,
'
number
'
,
"
First cycle day bleeding value
is
a number.
"
)
assert
.
equal
(
typeof
cycle
[
0
].
bleeding
.
value
,
'
number
'
,
"
First cycle day bleeding value
must be
a number.
"
)
cycle
.
forEach
(
day
=>
{
cycle
.
forEach
(
day
=>
{
assert
.
equal
(
typeof
day
.
date
,
'
string
'
,
"
Date
is
given as a string.
"
)
assert
.
equal
(
typeof
day
.
date
,
'
string
'
,
"
Date
must be
given as a string.
"
)
assert
.
doesNotThrow
(()
=>
LocalDate
.
parse
(
day
.
date
),
"
Date
is
given in right string format.
"
)
assert
.
doesNotThrow
(()
=>
LocalDate
.
parse
(
day
.
date
),
"
Date
must be
given in right string format.
"
)
if
(
day
.
temperature
)
assert
.
equal
(
typeof
day
.
temperature
.
value
,
'
number
'
,
"
Temperature value
is
a number.
"
)
if
(
day
.
temperature
)
assert
.
equal
(
typeof
day
.
temperature
.
value
,
'
number
'
,
"
Temperature value
must be
a number.
"
)
if
(
day
.
mucus
)
assert
.
equal
(
typeof
day
.
mucus
.
value
,
'
number
'
,
"
Mucus value
is
a number.
"
)
if
(
day
.
mucus
)
assert
.
equal
(
typeof
day
.
mucus
.
value
,
'
number
'
,
"
Mucus value
must be
a number.
"
)
if
(
day
.
mucus
)
assert
.
ok
(
day
.
mucus
.
value
>=
0
,
"
Mucus value
is
greater or equal to 0.
"
)
if
(
day
.
mucus
)
assert
.
ok
(
day
.
mucus
.
value
>=
0
,
"
Mucus value
must
greater or equal to 0.
"
)
if
(
day
.
mucus
)
assert
.
ok
(
day
.
mucus
.
value
<=
4
,
"
Mucus value below 5.
"
)
if
(
day
.
mucus
)
assert
.
ok
(
day
.
mucus
.
value
<=
4
,
"
Mucus value
must be
below 5.
"
)
if
(
day
.
cervix
)
assert
.
ok
(
day
.
cervix
.
value
.
opening
>=
0
,
"
c
ervix opening value must be 0 or bigger
"
)
if
(
day
.
cervix
)
assert
.
ok
(
day
.
cervix
.
value
.
opening
>=
0
,
"
C
ervix opening value must be 0 or bigger
"
)
if
(
day
.
cervix
)
assert
.
ok
(
day
.
cervix
.
value
.
opening
<=
2
,
"
c
ervix opening value must be 2 or smaller
"
)
if
(
day
.
cervix
)
assert
.
ok
(
day
.
cervix
.
value
.
opening
<=
2
,
"
C
ervix opening value must be 2 or smaller
"
)
if
(
day
.
cervix
)
assert
.
ok
(
day
.
cervix
.
value
.
firmness
>=
0
,
"
c
ervix firmness value must be 0 or bigger
"
)
if
(
day
.
cervix
)
assert
.
ok
(
day
.
cervix
.
value
.
firmness
>=
0
,
"
C
ervix firmness value must be 0 or bigger
"
)
if
(
day
.
cervix
)
assert
.
ok
(
day
.
cervix
.
value
.
firmness
<=
1
,
"
c
ervix firmness value must be 1 or smaller
"
)
if
(
day
.
cervix
)
assert
.
ok
(
day
.
cervix
.
value
.
firmness
<=
1
,
"
C
ervix firmness value must be 1 or smaller
"
)
assert
.
equal
(
typeof
cycle
[
0
].
bleeding
.
value
,
'
number
'
,
"
Bleeding value must be a number
"
)
assert
.
equal
(
typeof
cycle
[
0
].
bleeding
.
value
,
'
number
'
,
"
Bleeding value must be a number
"
)
})
})
})
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment