Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Fi1osof committed Oct 29, 2018
1 parent c252231 commit a7a3502
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 40 deletions.
10 changes: 6 additions & 4 deletions src/__tests__/server/default/mock/module/index.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

import chalk from "chalk";


import PrismaModule from "@prisma-cms/prisma-module";
import CmsModule from "../../../../../server/modules";

import InnerModule from "./innerModule";
Expand Down Expand Up @@ -48,16 +50,16 @@ class TestModule extends CmsModule {
}


getApiSchema(types = []) {
getApiSchema(types = [], excludeTypes = []) {

/**
* Hack for imitate = "src/schema/generated/prisma.graphql";
*/
let baseSchema = this.getSchema();
// let baseSchema = this.getSchema();

// console.log("baseSchema", baseSchema);

let apiSchema = super.getApiSchema(types.concat([baseSchema]), []);
let apiSchema = super.getApiSchema(types.concat(excludeTypes), []);

// console.log(chalk.green("TestModule apiSchema"), apiSchema);

Expand Down Expand Up @@ -89,7 +91,7 @@ class TestModule extends CmsModule {


export {
CmsModule as PrismaModule,
PrismaModule,
}

export default TestModule;
35 changes: 0 additions & 35 deletions src/__tests__/server/default/mock/schema.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const requiredTypes = [
name: "Query",
fields: {
both: [
"testUsers",
],
prisma: [
],
Expand All @@ -43,40 +42,6 @@ const requiredTypes = [
],
},
},
{
name: "TestUser",
fields: {
both: [
"testUsername",
],
prisma: [
"prismaTestUsername",
],
api: [
"apiTestUsername",
],
},
},
{
name: "TestUserCreateInput",
fields: {
api: [
"testUsername",
],
},
},
{
name: "TestEnumFields",
fields: {
both: [
],
api: [
"TestField",
],
prisma: [
],
},
},
]


Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/server/default/schema.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const verifyTypes = function (types, requiredTypes, verbose = false) {
;

}


if (!finded) {
throw (`Can not find field ${name}:${fieldName}`);
Expand Down

0 comments on commit a7a3502

Please sign in to comment.