-
-
Notifications
You must be signed in to change notification settings - Fork 88
Expand file tree
/
Copy pathbrowser-test.manual.js
More file actions
19 lines (16 loc) · 722 Bytes
/
browser-test.manual.js
File metadata and controls
19 lines (16 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Need to test manually in DevTools
// $ npx esbuild browser-test.manual.js --bundle | pbcopy
import isOnline from './browser.js';
// eslint-disable-next-line unicorn/prefer-top-level-await
(async () => {
console.log('Basic check - is online:', await isOnline());
// Test with fallback URLs (should only be called if main check fails)
console.log('With fallback URLs:', await isOnline({
fallbackUrls: ['https://checkip.amazonaws.com'],
}));
// Test with very short timeout to force main check to fail and use fallback
console.log('With short timeout and fallback:', await isOnline({
timeout: 1, // Very short timeout to force main check to fail
fallbackUrls: ['https://checkip.amazonaws.com'],
}));
})();