2021-04-16 04:34:29 +00:00
|
|
|
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
|
|
|
|
2021-04-16 04:34:29 +00:00
|
|
|
test('loads types from their module', (t) => {
|
2017-11-18 08:35:28 +00:00
|
|
|
t.is(
|
|
|
|
|
Node.resolveType({ _type: 'release-group' }, {}, { schema }),
|
|
|
|
|
ReleaseGroup
|
2021-04-16 04:34:29 +00:00
|
|
|
);
|
|
|
|
|
});
|
2016-12-12 05:56:28 +00:00
|
|
|
|
2021-04-16 04:34:29 +00:00
|
|
|
test('returns undefined for unknown types', (t) => {
|
|
|
|
|
t.is(Node.resolveType({ _type: 'foo' }, {}, { schema }), undefined);
|
|
|
|
|
});
|