Test cleanup and fixes [a-b]

This commit is contained in:
Angelos Chalaris
2018-06-18 15:54:48 +03:00
parent 4f7da1be9b
commit d29974ebc9
151 changed files with 753 additions and 373 deletions

View File

@ -5,15 +5,35 @@ const isEmpty = require('./isEmpty.js');
test('isEmpty is a Function', () => {
expect(isEmpty).toBeInstanceOf(Function);
});
t.equal(isEmpty(new Map()), true, 'Returns true for empty Map');
t.equal(isEmpty(new Set()), true, 'Returns true for empty Set');
t.equal(isEmpty([]), true, 'Returns true for empty array');
t.equal(isEmpty({}), true, 'Returns true for empty object');
t.equal(isEmpty(''), true, 'Returns true for empty string');
t.equal(isEmpty([1, 2]), false, 'Returns false for non-empty array');
t.equal(isEmpty({ a: 1, b: 2 }), false, 'Returns false for non-empty object');
t.equal(isEmpty('text'), false, 'Returns false for non-empty string');
t.equal(isEmpty(123), true, 'Returns true - type is not considered a collection');
t.equal(isEmpty(true), true, 'Returns true - type is not considered a collection');
test('Returns true for empty Map', () => {
expect(isEmpty(new Map()), true).toBe()
});
test('Returns true for empty Set', () => {
expect(isEmpty(new Set()), true).toBe()
});
test('Returns true for empty array', () => {
expect(isEmpty([]), true).toBe()
});
test('Returns true for empty object', () => {
expect(isEmpty({}), true).toBe()
});
test('Returns true for empty string', () => {
expect(isEmpty(''), true).toBe()
});
test('Returns false for non-empty array', () => {
expect(isEmpty([1, 2]), false).toBe()
});
test('Returns false for non-empty object', () => {
expect(isEmpty({ a: 1, b: 2 }), false).toBe()
});
test('Returns false for non-empty string', () => {
expect(isEmpty('text'), false).toBe()
});
test('Returns true - type is not considered a collection', () => {
expect(isEmpty(123), true).toBe()
});
test('Returns true - type is not considered a collection', () => {
expect(isEmpty(true), true).toBe()
});