@graphql-codegen/testing 4.0.4 → 4.0.5-alpha-20260402144834-a9c46613cbf89fefee54fbcb7b8264006c2345db
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/cjs/index.js +1 -1
- package/cjs/resolvers-common.js +1 -1
- package/cjs/typescript.js +7 -1
- package/esm/index.js +1 -1
- package/esm/resolvers-common.js +1 -1
- package/esm/typescript.js +7 -1
- package/package.json +4 -4
- package/typings/typescript.d.cts +1 -1
- package/typings/typescript.d.ts +1 -1
package/cjs/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const vitest_1 = require("vitest");
|
|
5
4
|
const common_tags_1 = require("common-tags");
|
|
6
5
|
const jest_diff_1 = require("jest-diff");
|
|
6
|
+
const vitest_1 = require("vitest");
|
|
7
7
|
function compareStrings(a, b) {
|
|
8
8
|
return a.includes(b);
|
|
9
9
|
}
|
package/cjs/resolvers-common.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolversTestingValidate = exports.resolversTestingSchema = void 0;
|
|
4
|
+
const graphql_1 = require("graphql");
|
|
4
5
|
const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
|
|
5
6
|
const testing_1 = require("@graphql-codegen/testing");
|
|
6
7
|
const typescript_1 = require("@graphql-codegen/typescript");
|
|
7
|
-
const graphql_1 = require("graphql");
|
|
8
8
|
exports.resolversTestingSchema = (0, graphql_1.buildSchema)(/* GraphQL */ `
|
|
9
9
|
type MyType {
|
|
10
10
|
foo: String! @authenticated
|
package/cjs/typescript.js
CHANGED
|
@@ -40,7 +40,13 @@ function validateTs(pluginOutput, options = {
|
|
|
40
40
|
}
|
|
41
41
|
const contents = typeof pluginOutput === 'string'
|
|
42
42
|
? pluginOutput
|
|
43
|
-
: [
|
|
43
|
+
: [
|
|
44
|
+
...new Set([
|
|
45
|
+
...(pluginOutput.prepend || []),
|
|
46
|
+
pluginOutput.content,
|
|
47
|
+
...(pluginOutput.append || []),
|
|
48
|
+
]),
|
|
49
|
+
].join('\n');
|
|
44
50
|
const testFile = `test-file.${isTsx ? 'tsx' : 'ts'}`;
|
|
45
51
|
const errors = [];
|
|
46
52
|
if (compileProgram) {
|
package/esm/index.js
CHANGED
package/esm/resolvers-common.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { buildSchema } from 'graphql';
|
|
1
2
|
import { mergeOutputs } from '@graphql-codegen/plugin-helpers';
|
|
2
3
|
import { validateTs } from '@graphql-codegen/testing';
|
|
3
4
|
import { plugin as tsPlugin } from '@graphql-codegen/typescript';
|
|
4
|
-
import { buildSchema } from 'graphql';
|
|
5
5
|
export const resolversTestingSchema = buildSchema(/* GraphQL */ `
|
|
6
6
|
type MyType {
|
|
7
7
|
foo: String! @authenticated
|
package/esm/typescript.js
CHANGED
|
@@ -35,7 +35,13 @@ export function validateTs(pluginOutput, options = {
|
|
|
35
35
|
}
|
|
36
36
|
const contents = typeof pluginOutput === 'string'
|
|
37
37
|
? pluginOutput
|
|
38
|
-
: [
|
|
38
|
+
: [
|
|
39
|
+
...new Set([
|
|
40
|
+
...(pluginOutput.prepend || []),
|
|
41
|
+
pluginOutput.content,
|
|
42
|
+
...(pluginOutput.append || []),
|
|
43
|
+
]),
|
|
44
|
+
].join('\n');
|
|
39
45
|
const testFile = `test-file.${isTsx ? 'tsx' : 'ts'}`;
|
|
40
46
|
const errors = [];
|
|
41
47
|
if (compileProgram) {
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/testing",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5-alpha-20260402144834-a9c46613cbf89fefee54fbcb7b8264006c2345db",
|
|
4
4
|
"description": "GraphQL Codegen Testing Utils",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"jest-diff": "^23.0.0 || ^24.0.0 || ^25.0.0 || ^26.0.0 || ^27.0.0 || ^28.0.0 || ^29.0.0 || ^30.0.0",
|
|
7
7
|
"typescript": ">=3.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@graphql-codegen/plugin-helpers": "
|
|
10
|
+
"@graphql-codegen/plugin-helpers": "6.2.1-alpha-20260402144834-a9c46613cbf89fefee54fbcb7b8264006c2345db",
|
|
11
11
|
"common-tags": "^1.8.0",
|
|
12
|
-
"lz-string": "^1.4.4",
|
|
13
12
|
"graphql-helix": "1.13.0",
|
|
13
|
+
"lz-string": "^1.4.4",
|
|
14
14
|
"nock": "^14.0.0",
|
|
15
|
-
"tslib": "~2.
|
|
15
|
+
"tslib": "~2.8.0"
|
|
16
16
|
},
|
|
17
17
|
"repository": "git@github.com:dotansimha/graphql-code-generator.git",
|
|
18
18
|
"homepage": "https://github.com/dotansimha/graphql-code-generator#readme",
|
package/typings/typescript.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '@graphql-codegen/plugin-helpers';
|
|
2
1
|
import { CompilerOptions } from 'typescript';
|
|
2
|
+
import { Types } from '@graphql-codegen/plugin-helpers';
|
|
3
3
|
export declare function validateTs(pluginOutput: Types.PluginOutput, options?: CompilerOptions, isTsx?: boolean, isStrict?: boolean, suspenseErrors?: string[], compileProgram?: boolean): void;
|
|
4
4
|
export declare function compileTs(contents: string, options?: CompilerOptions, isTsx?: boolean, openPlayground?: boolean): void;
|
package/typings/typescript.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '@graphql-codegen/plugin-helpers';
|
|
2
1
|
import { CompilerOptions } from 'typescript';
|
|
2
|
+
import { Types } from '@graphql-codegen/plugin-helpers';
|
|
3
3
|
export declare function validateTs(pluginOutput: Types.PluginOutput, options?: CompilerOptions, isTsx?: boolean, isStrict?: boolean, suspenseErrors?: string[], compileProgram?: boolean): void;
|
|
4
4
|
export declare function compileTs(contents: string, options?: CompilerOptions, isTsx?: boolean, openPlayground?: boolean): void;
|