graphbrainz/test/types/node.js

16 lines
474 B
JavaScript
Raw Permalink Normal View History

import test from 'ava';
import { Node } from '../../src/types/node.js';
import { ReleaseGroup } from '../../src/types/release-group.js';
import { baseSchema as schema } from '../../src/schema.js';
2016-12-12 05:56:28 +00:00
test('loads types from their module', (t) => {
t.is(
Node.resolveType({ _type: 'release-group' }, {}, { schema }),
ReleaseGroup
);
});
2016-12-12 05:56:28 +00:00
test('returns undefined for unknown types', (t) => {
t.is(Node.resolveType({ _type: 'foo' }, {}, { schema }), undefined);
});