feat: Add better support for non-native errors

This commit is contained in:
Joachim Van Herwegen
2021-06-07 15:54:28 +02:00
parent cefc866109
commit 7cfb87e516
25 changed files with 111 additions and 98 deletions

View File

@@ -4,7 +4,7 @@ import {
getBestPreference,
getConversionTarget,
getTypeWeight,
getWeightedPreferences,
getWeightedPreferences, isInternalContentType,
matchesMediaPreferences,
matchesMediaType,
} from '../../../../src/storage/conversion/ConversionUtil';
@@ -144,4 +144,13 @@ describe('ConversionUtil', (): void => {
expect(matchesMediaType('text/plain', 'text/turtle')).toBeFalsy();
});
});
describe('#isInternalContentType', (): void => {
it('only returns true on internal types.', async(): Promise<void> => {
expect(isInternalContentType('internal/quads')).toBeTruthy();
expect(isInternalContentType()).toBeFalsy();
expect(isInternalContentType('text/turtle')).toBeFalsy();
});
});
});