UNPKG

charlotte-graphql

Version:

Generates GraphQL type definitions and resolvers off of a concise spec.

33 lines (29 loc) 917 B
'use strict'; const runUnitTests = require('./unit'); const runIntegrationTests = require('./integration'); const typesExpanded = require('../../lib/helpers').expandTypes(require('./types')); module.exports = adapter => { const _afterEach = () => { return Promise.all( Object.values(typesExpanded).filter(type => !type.isScalar).map(type => { return adapter .find(type, { pagination: { limit: 99999 } }) .then(hyperedges => { return Promise.all( hyperedges.map(hyperedge => { return adapter.remove(type, hyperedge); }) ); }); }) ); }; describe('Charlotte', () => { describe('unit tests', () => runUnitTests(adapter, _afterEach)); describe('GraphQL integration tests', () => runIntegrationTests(adapter, _afterEach)); }); };