@envelop/testing 10.1.1 → 10.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +3 -1
- package/cjs/index.js +3 -3
- package/esm/index.js +3 -3
- package/package.json +8 -7
- package/typings/index.d.cts +8 -8
- package/typings/index.d.ts +8 -8
package/LICENSE
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2020
|
|
3
|
+
Copyright (c) 2018-2020 Graphcool
|
|
4
|
+
Copyright (c) 2020-2021 Prisma
|
|
5
|
+
Copyright (c) 2021- The Guild
|
|
4
6
|
|
|
5
7
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
8
|
of this software and associated documentation files (the "Software"), to deal
|
package/cjs/index.js
CHANGED
|
@@ -6,7 +6,8 @@ exports.createTestkit = createTestkit;
|
|
|
6
6
|
exports.assertSingleExecutionValue = assertSingleExecutionValue;
|
|
7
7
|
exports.assertStreamExecutionValue = assertStreamExecutionValue;
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
|
-
const
|
|
9
|
+
const node_util_1 = require("node:util");
|
|
10
|
+
// eslint-disable-next-line no-restricted-imports
|
|
10
11
|
const GraphQLJS = tslib_1.__importStar(require("graphql"));
|
|
11
12
|
const graphql_1 = require("graphql");
|
|
12
13
|
const core_1 = require("@envelop/core");
|
|
@@ -16,7 +17,6 @@ const useGraphQLJSEngine = () => {
|
|
|
16
17
|
return (0, core_1.useEngine)(GraphQLJS);
|
|
17
18
|
};
|
|
18
19
|
exports.useGraphQLJSEngine = useGraphQLJSEngine;
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
20
20
|
function createSpiedPlugin() {
|
|
21
21
|
const afterResolver = jest.fn();
|
|
22
22
|
const baseSpies = {
|
|
@@ -181,7 +181,7 @@ function assertSingleExecutionValue(input) {
|
|
|
181
181
|
}
|
|
182
182
|
function assertStreamExecutionValue(input) {
|
|
183
183
|
if (!(0, core_1.isAsyncIterable)(input)) {
|
|
184
|
-
throw new Error('Received single result but expected stream.' + (0,
|
|
184
|
+
throw new Error('Received single result but expected stream.' + (0, node_util_1.inspect)(input));
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
const collectAsyncIteratorValues = async (asyncIterable) => {
|
package/esm/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { inspect } from 'util';
|
|
1
|
+
import { inspect } from 'node:util';
|
|
2
|
+
// eslint-disable-next-line no-restricted-imports
|
|
2
3
|
import * as GraphQLJS from 'graphql';
|
|
3
|
-
import { getOperationAST, GraphQLError, print
|
|
4
|
+
import { getOperationAST, GraphQLError, print } from 'graphql';
|
|
4
5
|
import { envelop, getDocumentString, isAsyncIterable, useEngine, useSchema } from '@envelop/core';
|
|
5
6
|
import { mapSchema as cloneSchema, isDocumentNode } from '@graphql-tools/utils';
|
|
6
7
|
import { handleMaybePromise } from '@whatwg-node/promise-helpers';
|
|
7
8
|
export const useGraphQLJSEngine = () => {
|
|
8
9
|
return useEngine(GraphQLJS);
|
|
9
10
|
};
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
11
11
|
export function createSpiedPlugin() {
|
|
12
12
|
const afterResolver = jest.fn();
|
|
13
13
|
const baseSpies = {
|
package/package.json
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/testing",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
7
|
-
"@envelop/core": "^5.
|
|
8
|
-
"@envelop/types": "^5.2.
|
|
6
|
+
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
7
|
+
"@envelop/core": "^5.6.1",
|
|
8
|
+
"@envelop/types": "^5.2.2"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@graphql-tools/utils": "^11.
|
|
11
|
+
"@graphql-tools/utils": "^11.2.0",
|
|
12
12
|
"@whatwg-node/promise-helpers": "^1.2.4",
|
|
13
13
|
"tslib": "^2.5.0"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/graphql-hive/
|
|
18
|
-
"directory": "packages/testing"
|
|
17
|
+
"url": "https://github.com/graphql-hive/graphql-yoga.git",
|
|
18
|
+
"directory": "packages/envelop/testing"
|
|
19
19
|
},
|
|
20
|
+
"homepage": "https://github.com/graphql-hive/graphql-yoga/tree/main/packages/envelop/testing#readme",
|
|
20
21
|
"author": "Dotan Simha <dotansimha@gmail.com>",
|
|
21
22
|
"license": "MIT",
|
|
22
23
|
"engines": {
|
package/typings/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DocumentNode, ExecutionResult, GraphQLSchema } from 'graphql';
|
|
1
|
+
import type { DocumentNode, ExecutionResult, GraphQLSchema } from 'graphql';
|
|
2
2
|
import { envelop } from '@envelop/core';
|
|
3
|
-
import { GetEnvelopedFn, Plugin } from '@envelop/types';
|
|
3
|
+
import type { GetEnvelopedFn, Plugin } from '@envelop/types';
|
|
4
4
|
export declare const useGraphQLJSEngine: () => Plugin<{}>;
|
|
5
5
|
export type ModifyPluginsFn = (plugins: Plugin<any>[]) => Plugin<any>[];
|
|
6
6
|
export type PhaseReplacementParams = {
|
|
@@ -22,12 +22,6 @@ export type PhaseReplacementParams = {
|
|
|
22
22
|
export declare function createSpiedPlugin(): {
|
|
23
23
|
reset: () => void;
|
|
24
24
|
spies: {
|
|
25
|
-
beforeParse: jest.Mock<jest.Mock<any, any, any>, [], any>;
|
|
26
|
-
beforeValidate: jest.Mock<jest.Mock<any, any, any>, [], any>;
|
|
27
|
-
beforeContextBuilding: jest.Mock<jest.Mock<any, any, any>, [], any>;
|
|
28
|
-
beforeExecute: jest.Mock<{
|
|
29
|
-
onExecuteDone: jest.Mock<any, any, any>;
|
|
30
|
-
}, [], any>;
|
|
31
25
|
onSchemaChange: jest.Mock<any, any, any>;
|
|
32
26
|
afterParse: jest.Mock<any, any, any>;
|
|
33
27
|
afterValidate: jest.Mock<any, any, any>;
|
|
@@ -35,6 +29,12 @@ export declare function createSpiedPlugin(): {
|
|
|
35
29
|
afterExecute: jest.Mock<any, any, any>;
|
|
36
30
|
afterResolver: jest.Mock<any, any, any>;
|
|
37
31
|
beforeResolver: jest.Mock<jest.Mock<any, any, any>, [], any>;
|
|
32
|
+
beforeParse: jest.Mock<jest.Mock<any, any, any>, [], any>;
|
|
33
|
+
beforeValidate: jest.Mock<jest.Mock<any, any, any>, [], any>;
|
|
34
|
+
beforeContextBuilding: jest.Mock<jest.Mock<any, any, any>, [], any>;
|
|
35
|
+
beforeExecute: jest.Mock<{
|
|
36
|
+
onExecuteDone: jest.Mock<any, any, any>;
|
|
37
|
+
}, [], any>;
|
|
38
38
|
};
|
|
39
39
|
plugin: Plugin;
|
|
40
40
|
};
|
package/typings/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DocumentNode, ExecutionResult, GraphQLSchema } from 'graphql';
|
|
1
|
+
import type { DocumentNode, ExecutionResult, GraphQLSchema } from 'graphql';
|
|
2
2
|
import { envelop } from '@envelop/core';
|
|
3
|
-
import { GetEnvelopedFn, Plugin } from '@envelop/types';
|
|
3
|
+
import type { GetEnvelopedFn, Plugin } from '@envelop/types';
|
|
4
4
|
export declare const useGraphQLJSEngine: () => Plugin<{}>;
|
|
5
5
|
export type ModifyPluginsFn = (plugins: Plugin<any>[]) => Plugin<any>[];
|
|
6
6
|
export type PhaseReplacementParams = {
|
|
@@ -22,12 +22,6 @@ export type PhaseReplacementParams = {
|
|
|
22
22
|
export declare function createSpiedPlugin(): {
|
|
23
23
|
reset: () => void;
|
|
24
24
|
spies: {
|
|
25
|
-
beforeParse: jest.Mock<jest.Mock<any, any, any>, [], any>;
|
|
26
|
-
beforeValidate: jest.Mock<jest.Mock<any, any, any>, [], any>;
|
|
27
|
-
beforeContextBuilding: jest.Mock<jest.Mock<any, any, any>, [], any>;
|
|
28
|
-
beforeExecute: jest.Mock<{
|
|
29
|
-
onExecuteDone: jest.Mock<any, any, any>;
|
|
30
|
-
}, [], any>;
|
|
31
25
|
onSchemaChange: jest.Mock<any, any, any>;
|
|
32
26
|
afterParse: jest.Mock<any, any, any>;
|
|
33
27
|
afterValidate: jest.Mock<any, any, any>;
|
|
@@ -35,6 +29,12 @@ export declare function createSpiedPlugin(): {
|
|
|
35
29
|
afterExecute: jest.Mock<any, any, any>;
|
|
36
30
|
afterResolver: jest.Mock<any, any, any>;
|
|
37
31
|
beforeResolver: jest.Mock<jest.Mock<any, any, any>, [], any>;
|
|
32
|
+
beforeParse: jest.Mock<jest.Mock<any, any, any>, [], any>;
|
|
33
|
+
beforeValidate: jest.Mock<jest.Mock<any, any, any>, [], any>;
|
|
34
|
+
beforeContextBuilding: jest.Mock<jest.Mock<any, any, any>, [], any>;
|
|
35
|
+
beforeExecute: jest.Mock<{
|
|
36
|
+
onExecuteDone: jest.Mock<any, any, any>;
|
|
37
|
+
}, [], any>;
|
|
38
38
|
};
|
|
39
39
|
plugin: Plugin;
|
|
40
40
|
};
|