Skip to content

Commit

Permalink
Start more expansionMap tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlehn committed Jul 7, 2022
1 parent 27d40c1 commit e37991f
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions tests/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down

0 comments on commit e37991f

Please sign in to comment.