Skip to content

Commit 0967732

Browse files
committed
Start more expansionMap tests.
1 parent d8b685b commit 0967732

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

tests/misc.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,56 @@ describe.only('expansionMap', () => {
523523
}
524524

525525
describe('unmappedProperty', () => {
526+
// FIXME move to value section
527+
it.skip('should have zero counts with empty input', async () => {
528+
const docWithNoContent = {};
529+
530+
const counts = {};
531+
const expansionMap = info => {
532+
addCounts(counts, info);
533+
};
534+
535+
await jsonld.expand(docWithNoContent, {expansionMap});
536+
537+
assert.deepStrictEqual(counts, {});
538+
});
539+
540+
// FIXME move to value section
541+
it.skip('should have zero counts with no terms', async () => {
542+
const docWithNoTerms = {
543+
'@context': {
544+
'definedTerm': 'https://example.com#definedTerm'
545+
}
546+
};
547+
548+
const counts = {};
549+
const expansionMap = info => {
550+
addCounts(counts, info);
551+
};
552+
553+
await jsonld.expand(docWithNoTerms, {expansionMap});
554+
555+
assert.deepStrictEqual(counts, {});
556+
});
557+
558+
it.skip('should have zero counts with mapped term', async () => {
559+
const docWithMappedTerm = {
560+
'@context': {
561+
'definedTerm': 'https://example.com#definedTerm'
562+
},
563+
definedTerm: "is defined"
564+
};
565+
566+
const counts = {};
567+
const expansionMap = info => {
568+
addCounts(counts, info);
569+
};
570+
571+
await jsonld.expand(docWithMappedTerm, {expansionMap});
572+
573+
assert.deepStrictEqual(counts, {});
574+
});
575+
526576
it('should be called on unmapped term', async () => {
527577
const docWithUnMappedTerm = {
528578
'@context': {

0 commit comments

Comments
 (0)