Skip to content

Commit

Permalink
isolate testing entry point in graphql package
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-burel committed Dec 1, 2021
1 parent 3ecf377 commit 4ac4a2f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/graphql/fragments/tests/fragments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createModel } from "@vulcanjs/model";

import { createGraphqlModel } from "../../extendModel";
import { VulcanGraphqlModel } from "../../typings";
import { normalizeGraphQLSchema } from "../../testUtils";
import { normalizeGraphQLSchema } from "../../testing";
import { getDefaultFragmentText } from "../defaultFragment";
const test = it;

Expand Down
3 changes: 0 additions & 3 deletions packages/graphql/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@ export * from "./extendModel";
export * from "./fragments/defaultFragment";
export * from "./fragments/typings";
export * from "./fragments/utils";

// Used internally but could be useful to test user's graphql app
export * from "./testUtils";
6 changes: 5 additions & 1 deletion packages/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
],
"exports": {
".": "./dist/index.js",
"./server": "./dist/server/index.js"
"./server": "./dist/server/index.js",
"./testing": "./dist/testing.js"
},
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"server": [
"./dist/server/index.d.ts"
],
"testing": [
"./dist/testing.d.ts"
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/server/tests/graphql.test.ts.TODO
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createModel } from "@vulcanjs/model";
import SimpleSchema from "simpl-schema";
import extendModel from "../../extendModel";
import { VulcanGraphqlModel } from "../../typings";
import { normalizeGraphQLSchema } from "../../testUtils";
import { normalizeGraphQLSchema } from "../../testing";
import { getDefaultFragmentText } from "../defaultFragment";

import { GraphQLSchema } from "../../lib/server/graphql";
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/server/tests/typeDefs/parseModel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { createGraphqlModelServer } from "../../../extendModel.server";
import { normalizeGraphQLSchema } from "../../../testUtils";
import { normalizeGraphQLSchema } from "../../../testing";
import { parseSchema } from "../../parseSchema";
import { parseModel } from "../../parseModel";
import { buildDefaultMutationResolvers } from "../../resolvers/defaultMutationResolvers";
Expand Down
File renamed without changes.
6 changes: 5 additions & 1 deletion packages/graphql/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ const path = require("path");
const baseConfig = require("../../webpack/webpack.config.base.common.prod");
//const merge = require('webpack-merge')
module.exports = merge(baseConfig, {
entry: path.resolve(__dirname, "./index.ts"),
entry: {
index: path.resolve(__dirname, "./index.ts"),
testing: path.resolve(__dirname, "./testing.ts"),
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].js",
},
});

0 comments on commit 4ac4a2f

Please sign in to comment.