2016-12-12 05:56:28 +00:00
|
|
|
import test from 'ava'
|
|
|
|
|
import Node from '../../src/types/node'
|
|
|
|
|
import ReleaseGroup from '../../src/types/release-group'
|
2017-11-18 08:35:28 +00:00
|
|
|
import schema from '../../src/schema'
|
2016-12-12 05:56:28 +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
|
|
|
|
|
)
|
2016-12-12 05:56:28 +00:00
|
|
|
})
|
|
|
|
|
|
2017-11-18 08:35:28 +00:00
|
|
|
test('returns undefined for unknown types', t => {
|
|
|
|
|
t.is(Node.resolveType({ _type: 'foo' }, {}, { schema }), undefined)
|
2016-12-12 05:56:28 +00:00
|
|
|
})
|