From e37991f2f9c364ed9cbe01e691078f34f2fc9884 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Thu, 24 Mar 2022 00:06:09 -0400 Subject: [PATCH] Start more expansionMap tests. --- tests/misc.js | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tests/misc.js b/tests/misc.js index 22a1daa0..cfa65dbd 100644 --- a/tests/misc.js +++ b/tests/misc.js @@ -523,6 +523,56 @@ describe.only('expansionMap', () => { } describe('unmappedProperty', () => { + // FIXME move to value section + it.skip('should have zero counts with empty input', async () => { + const docWithNoContent = {}; + + const counts = {}; + const expansionMap = info => { + addCounts(counts, info); + }; + + await jsonld.expand(docWithNoContent, {expansionMap}); + + assert.deepStrictEqual(counts, {}); + }); + + // FIXME move to value section + it.skip('should have zero counts with no terms', async () => { + const docWithNoTerms = { + '@context': { + 'definedTerm': 'https://example.com#definedTerm' + } + }; + + const counts = {}; + const expansionMap = info => { + addCounts(counts, info); + }; + + await jsonld.expand(docWithNoTerms, {expansionMap}); + + assert.deepStrictEqual(counts, {}); + }); + + it.skip('should have zero counts with mapped term', async () => { + const docWithMappedTerm = { + '@context': { + 'definedTerm': 'https://example.com#definedTerm' + }, + definedTerm: "is defined" + }; + + const counts = {}; + const expansionMap = info => { + addCounts(counts, info); + }; + + await jsonld.expand(docWithMappedTerm, {expansionMap}); + + assert.deepStrictEqual(counts, {}); + }); + it('should be called on unmapped term', async () => { const docWithUnMappedTerm = { '@context': {