Skip to content

Latest commit

 

History

History
 
 

stubbing-spying__window-print

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Stubbing window.print

This is an example showing how to stub window.print method call

The application

The page index.html calls window.print on button click. Without stubbing, the test would click and then a system print dialog would block the rest of the test.

System print dialog

By stubbing the window.print the spec.js can confirm the call has happened.

Stub window print test