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:
1919 # print code coverage summary to the terminal
2020 # and make sure there the coverage is above certain limit
2121 - 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
2226 # publish new version if necessary
2327 - run : npm run semantic-release
Original file line number Diff line number Diff line change @@ -8,19 +8,24 @@ const { fixSourcePathes } = require('../../utils')
88context ( 'Page test' , ( ) => {
99 beforeEach ( ( ) => {
1010 cy . visit ( '/' , {
11- onBeforeLoad ( win ) {
11+ onBeforeLoad ( win ) {
1212 cy . spy ( win . console , 'log' ) . as ( 'log' )
1313 }
1414 } )
15-
16- cy . contains ( 'About' ) . click ( )
1715 } )
1816
19- it ( 'logs names' , function ( ) {
17+ it ( 'logs names' , function ( ) {
2018 cy . get ( '@log' )
2119 . should ( 'have.been.calledOnce' )
2220 . should ( 'have.been.calledWith' , 'just names' , [ 'joe' , 'mary' ] )
2321 } )
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+ } )
2429} )
2530
2631context ( 'Unit tests' , ( ) => {
You can’t perform that action at this time.
0 commit comments