siesta-lite
Version:
Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers
23 lines (16 loc) • 703 B
JavaScript
StartTest(t => {
MyGlobal = 'some expected global'
// some globals are expected
t.expectGlobals('MyGlobal');
// some are accidental "leak", try to uncomment the following code to see
// how the leak is detected
// If you find a global leak, you can use this trick to catch it (uncomment the for loop below first, and run in a modern browser)
// Object.defineProperty(global, 'i', {
// set : () => { debugger; }
// })
// t.diag('Testing simple for loop...');
//
// // try to uncomment this line to see the report about unexpected global - "i"
// // please note: this feature is not supported in IE <= 8
// for (i = 0; i < 10; i++) {}
});