Test cleanup and fixes [a-b]
This commit is contained in:
@ -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()
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user