Skip to content

Commit

Permalink
added and simplified unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcmaro committed Jan 24, 2025
1 parent ca528d4 commit 4fb1df6
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions test/CtrlxCore.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,23 @@ describe('CtrlxCore', function() {

it('should parse raw data (types/datalayer/raw', function(done) {

let raw = 'PKWrNViZ�g�sampleSchema.fbs]�;�0D�=Ş@{��ֶ�ʊBbB��Q����S����X�5�f��@ƥ��e3�z~LvB]ZV3{�H7��0e-�h�� ��o����C�PK?WrNViZ�g�$ sampleSchema.fbs ,��v@�PKb�';
expect(CtrlxDatalayer._parseData(raw).value).to.equal(raw)
const raw = '��ֶ�ʊBbB��Q����S����X�5�f��@ƥ��e3�z~LvB]ZV3{�H7��0e-�h�� ��';

const data = CtrlxDatalayer._parseData(raw);
expect(data.value).to.equal(raw)
expect(data.type).to.be.a('string').eql('raw');

done();
});

it('should parse invalid JSON', function(done) {

const invalidJSON = 'test/invalid/json';

const data = CtrlxDatalayer._parseData(invalidJSON);
expect(data.value).to.equal(invalidJSON)
expect(data.type).to.be.a('string').eql('raw');

done();
});

Expand Down

0 comments on commit 4fb1df6

Please sign in to comment.