File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -19,5 +19,9 @@ workflows:
19
19
# print code coverage summary to the terminal
20
20
# and make sure there the coverage is above certain limit
21
21
- run : npx nyc report --check-coverage true --lines 80
22
+ # make sure second page (about.html) has its JavaScript counted and covered
23
+ - run : npx nyc report --check-coverage true --lines 100 --include cypress/about.js
24
+ # make sure unit tests are covered
25
+ - run : npx nyc report --check-coverage true --lines 100 --include cypress/unit.js
22
26
# publish new version if necessary
23
27
- run : npm run semantic-release
Original file line number Diff line number Diff line change @@ -8,19 +8,24 @@ const { fixSourcePathes } = require('../../utils')
8
8
context ( 'Page test' , ( ) => {
9
9
beforeEach ( ( ) => {
10
10
cy . visit ( '/' , {
11
- onBeforeLoad ( win ) {
11
+ onBeforeLoad ( win ) {
12
12
cy . spy ( win . console , 'log' ) . as ( 'log' )
13
13
}
14
14
} )
15
-
16
- cy . contains ( 'About' ) . click ( )
17
15
} )
18
16
19
- it ( 'logs names' , function ( ) {
17
+ it ( 'logs names' , function ( ) {
20
18
cy . get ( '@log' )
21
19
. should ( 'have.been.calledOnce' )
22
20
. should ( 'have.been.calledWith' , 'just names' , [ 'joe' , 'mary' ] )
23
21
} )
22
+
23
+ it ( 'loads About page' , ( ) => {
24
+ cy . contains ( 'About' ) . click ( )
25
+ cy . url ( ) . should ( 'match' , / \/ a b o u t / )
26
+ cy . contains ( 'h2' , 'About' )
27
+ cy . contains ( 'Est. 2019' )
28
+ } )
24
29
} )
25
30
26
31
context ( 'Unit tests' , ( ) => {
You can’t perform that action at this time.
0 commit comments