feat: Determine Typed Converter output based on input type

This commit is contained in:
Joachim Van Herwegen
2021-10-26 16:30:10 +02:00
parent 27306d6e3f
commit fa94c7d4bb
17 changed files with 107 additions and 134 deletions

View File

@@ -6,7 +6,7 @@ import {
getTypeWeight,
getWeightedPreferences, isInternalContentType,
matchesMediaPreferences,
matchesMediaType,
matchesMediaType, preferencesToString,
} from '../../../../src/storage/conversion/ConversionUtil';
import { InternalServerError } from '../../../../src/util/errors/InternalServerError';
@@ -153,4 +153,11 @@ describe('ConversionUtil', (): void => {
expect(isInternalContentType('text/turtle')).toBeFalsy();
});
});
describe('#preferencesToString', (): void => {
it('returns a string serialization.', async(): Promise<void> => {
const preferences: ValuePreferences = { 'a/*': 1, 'b/b': 0.8, 'c/c': 0 };
expect(preferencesToString(preferences)).toEqual('a/*:1,b/b:0.8,c/c:0');
});
});
});