Skip to content

Commit

Permalink
tests for anonymous function resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryGH authored Jun 28, 2021
1 parent 442a956 commit 27018f6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion JSONPP.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
let JSONPP = require('./JSONPP.js');

describe('JSONPP', () => {
it('should work with multiple stringify/parse calls', () => {
let foo = {
bar: (baz) => { return (baz + 1); }
};
let bar = JSONPP.stringify(foo);
let baz = JSONPP.parse(bar);
let check = JSONPP.stringify(baz);
let test = '{"bar":(baz\n) => {\n{\n return baz + 1;\n }\n}}';
expect(check).toBe(test);
});
});
describe('JSONPP.parse', () => {
it('should work with root object', () => {
let test = '{"foo":"bar"}';
Expand Down Expand Up @@ -291,4 +303,4 @@ describe('JSONPP.stringify', () => {
return ((key !== 'baz') && ((key !== 1)));
})).toBe(check);
});
});
});

0 comments on commit 27018f6

Please sign in to comment.