Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrelmlins committed Sep 2, 2020
1 parent 5b78748 commit 8978f45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/compiler/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fs from 'fs';
import equal from 'fast-deep-equal';
import path from 'path';
import { assert } from 'chai';
import 'mocha';
import Recife from '../../src/Recife';

import Compiler from '../../src/compiler/Compiler';

Expand All @@ -21,7 +21,7 @@ describe('Compiler tests', () => {
await compiler.compile();

if (output.types) {
assert.equal(JSON.stringify(compiler.generateType()), JSON.stringify(output.types));
assert.isTrue(equal(destructor(compiler.generateType()), destructor(output.types)));
}

if (output.resolvers) {
Expand All @@ -32,3 +32,7 @@ describe('Compiler tests', () => {
});
});
});

const destructor = (object: any) => {
return JSON.parse(JSON.stringify(object));
};
4 changes: 4 additions & 0 deletions test/compiler/snapshot/compiler-basic/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,9 @@ module.exports = {
extend type Mutation {
createUser(input: CreateUserInput!): Input!
}
extend type Query {
recife: String!
}
`
};

0 comments on commit 8978f45

Please sign in to comment.