Add isBrowserTabFocused, fixed is tests
This commit is contained in:
@ -14,11 +14,11 @@ test('Testing is', (t) => {
|
||||
t.true(is(Set, new Set()), `Works for sets`);
|
||||
t.true(is(WeakMap, new WeakMap()), `Works for weak maps`);
|
||||
t.true(is(WeakSet, new WeakSet()), `Works for weak sets`);
|
||||
t.false(is(String, ''), `Works for strings - returns false for primitive`);
|
||||
t.true(is(String, ''), `Works for strings - returns true for primitive`);
|
||||
t.true(is(String, new String('')), `Works for strings - returns true when using constructor`);
|
||||
t.false(is(Number, 1), `Works for numbers - returns false for primitive`);
|
||||
t.true(is(Number, 1), `Works for numbers - returns true for primitive`);
|
||||
t.true(is(Number, new Number('10')), `Works for numbers - returns true when using constructor`);
|
||||
t.false(is(Boolean, false), `Works for booleans - returns false for primitive`);
|
||||
t.true(is(Boolean, false), `Works for booleans - returns true for primitive`);
|
||||
t.true(is(Boolean, new Boolean(false)), `Works for booleans - returns true when using constructor`);
|
||||
t.true(is(Function, () => null), `Works for functions`);
|
||||
//t.deepEqual(is(args..), 'Expected');
|
||||
|
||||
2
test/isBrowserTabFocused/isBrowserTabFocused.js
Normal file
2
test/isBrowserTabFocused/isBrowserTabFocused.js
Normal file
@ -0,0 +1,2 @@
|
||||
const isBrowserTabFocused = () => !document.hidden;
|
||||
module.exports = isBrowserTabFocused;
|
||||
13
test/isBrowserTabFocused/isBrowserTabFocused.test.js
Normal file
13
test/isBrowserTabFocused/isBrowserTabFocused.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const isBrowserTabFocused = require('./isBrowserTabFocused.js');
|
||||
|
||||
test('Testing isBrowserTabFocused', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof isBrowserTabFocused === 'function', 'isBrowserTabFocused is a Function');
|
||||
//t.deepEqual(isBrowserTabFocused(args..), 'Expected');
|
||||
//t.equal(isBrowserTabFocused(args..), 'Expected');
|
||||
//t.false(isBrowserTabFocused(args..), 'Expected');
|
||||
//t.throws(isBrowserTabFocused(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
2170
test/testlog
2170
test/testlog
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user