git clone [email protected]:ilyar/sandbox.git
cd sandbox/jest
npm i
npm test
PASS ./test.js
Test mocking global variable
✓ Mock global Object and use in local scope (93ms)
✓ Mock global Object and use in global scope (1ms)
Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 0.874s, estimated 1s
Ran all test suites.
----------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
All files | 100 | 100 | 100 | 100 | |
lib.js | 100 | 100 | 100 | 100 | |
----------|----------|----------|----------|----------|----------------|