Test cleanup and fixes [a-b]

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

View File

@ -5,7 +5,13 @@ const isValidJSON = require('./isValidJSON.js');
test('isValidJSON is a Function', () => {
expect(isValidJSON).toBeInstanceOf(Function);
});
t.equal(isValidJSON('{"name":"Adam","age":20}'), true, '{"name":"Adam","age":20} is a valid JSON');
t.equal(isValidJSON('{"name":"Adam",age:"20"}'), false, '{"name":"Adam",age:"20"} is not a valid JSON');
t.equal(isValidJSON(null), true, 'null is a valid JSON');
test('{"name":"Adam","age":20} is a valid JSON', () => {
expect(isValidJSON('{"name":"Adam","age":20}'), true).toBe()
});
test('{"name":"Adam",age:"20"} is not a valid JSON', () => {
expect(isValidJSON('{"name":"Adam",age:"20"}'), false).toBe()
});
test('null is a valid JSON', () => {
expect(isValidJSON(null), true).toBe()
});