@nest-boot/graphql 7.1.3 → 7.1.5
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/dist/decorators/args-type.decorator.d.ts +8 -0
- package/dist/decorators/args-type.decorator.js +9 -2
- package/dist/decorators/args-type.decorator.js.map +1 -1
- package/dist/decorators/args-type.decorator.spec.d.ts +0 -0
- package/dist/decorators/args-type.decorator.spec.js +63 -0
- package/dist/decorators/args-type.decorator.spec.js.map +1 -0
- package/dist/graphql.exception-filter.spec.d.ts +1 -0
- package/dist/graphql.exception-filter.spec.js +111 -0
- package/dist/graphql.exception-filter.spec.js.map +1 -0
- package/dist/index.spec.d.ts +1 -0
- package/dist/index.spec.js +47 -0
- package/dist/index.spec.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +9 -8
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Decorator that marks a class as a resolver arguments type.
|
|
3
3
|
*
|
|
4
|
+
* @param name - Optional GraphQL args type name. Use this for dynamically
|
|
5
|
+
* generated classes or classes whose TypeScript names are not unique.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* This extends NestJS' `ArgsType` behavior by allowing an explicit GraphQL
|
|
9
|
+
* metadata name. When omitted, the class name is used, matching NestJS'
|
|
10
|
+
* default behavior.
|
|
11
|
+
*
|
|
4
12
|
* @public
|
|
5
13
|
*/
|
|
6
14
|
export declare function ArgsType(name?: string): ClassDecorator;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ArgsType = ArgsType;
|
|
4
|
-
const class_type_enum_1 = require("@nestjs/graphql/dist/enums/class-type.enum");
|
|
5
4
|
const lazy_metadata_storage_1 = require("@nestjs/graphql/dist/schema-builder/storages/lazy-metadata.storage");
|
|
6
5
|
const type_metadata_storage_1 = require("@nestjs/graphql/dist/schema-builder/storages/type-metadata.storage");
|
|
7
6
|
const add_class_type_metadata_util_1 = require("@nestjs/graphql/dist/utils/add-class-type-metadata.util");
|
|
8
7
|
/**
|
|
9
8
|
* Decorator that marks a class as a resolver arguments type.
|
|
10
9
|
*
|
|
10
|
+
* @param name - Optional GraphQL args type name. Use this for dynamically
|
|
11
|
+
* generated classes or classes whose TypeScript names are not unique.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* This extends NestJS' `ArgsType` behavior by allowing an explicit GraphQL
|
|
15
|
+
* metadata name. When omitted, the class name is used, matching NestJS'
|
|
16
|
+
* default behavior.
|
|
17
|
+
*
|
|
11
18
|
* @public
|
|
12
19
|
*/
|
|
13
20
|
function ArgsType(name) {
|
|
@@ -23,7 +30,7 @@ function ArgsType(name) {
|
|
|
23
30
|
// This function must be called eagerly to allow resolvers
|
|
24
31
|
// accessing the "name" property
|
|
25
32
|
type_metadata_storage_1.TypeMetadataStorage.addArgsMetadata(metadata);
|
|
26
|
-
(0, add_class_type_metadata_util_1.addClassTypeMetadata)(target,
|
|
33
|
+
(0, add_class_type_metadata_util_1.addClassTypeMetadata)(target, "args");
|
|
27
34
|
};
|
|
28
35
|
}
|
|
29
36
|
//# sourceMappingURL=args-type.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args-type.decorator.js","sourceRoot":"","sources":["../../src/decorators/args-type.decorator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"args-type.decorator.js","sourceRoot":"","sources":["../../src/decorators/args-type.decorator.ts"],"names":[],"mappings":";;AAiBA,4BAkBC;AAnCD,8GAAyG;AACzG,8GAAyG;AACzG,0GAA+F;AAE/F;;;;;;;;;;;;GAYG;AACH,SAAgB,QAAQ,CAAC,IAAa;IACpC,sEAAsE;IACtE,OAAO,CAAC,MAAgB,EAAE,EAAE;QAC1B,MAAM,QAAQ,GAAG;YACf,IAAI,EAAE,IAAI,IAAI,MAAM,CAAC,IAAI;YACzB,MAAM;SACP,CAAC;QACF,2CAAmB,CAAC,KAAK,CAAC,GAAG,EAAE;YAC7B,2CAAmB,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QACH,0DAA0D;QAC1D,gCAAgC;QAChC,2CAAmB,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAA,mDAAoB,EAClB,MAAM,EACN,MAAoD,CACrD,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
describe("ArgsType", () => {
|
|
3
|
+
it("should register args metadata lazily and eagerly", () => {
|
|
4
|
+
const store = jest.fn((callback) => {
|
|
5
|
+
callback();
|
|
6
|
+
});
|
|
7
|
+
const addArgsMetadata = jest.fn();
|
|
8
|
+
const addClassTypeMetadata = jest.fn();
|
|
9
|
+
jest.isolateModules(() => {
|
|
10
|
+
jest.doMock("@nestjs/graphql/dist/schema-builder/storages/lazy-metadata.storage", () => ({
|
|
11
|
+
LazyMetadataStorage: {
|
|
12
|
+
store,
|
|
13
|
+
},
|
|
14
|
+
}));
|
|
15
|
+
jest.doMock("@nestjs/graphql/dist/schema-builder/storages/type-metadata.storage", () => ({
|
|
16
|
+
TypeMetadataStorage: {
|
|
17
|
+
addArgsMetadata,
|
|
18
|
+
},
|
|
19
|
+
}));
|
|
20
|
+
jest.doMock("@nestjs/graphql/dist/utils/add-class-type-metadata.util", () => ({
|
|
21
|
+
addClassTypeMetadata,
|
|
22
|
+
}));
|
|
23
|
+
const { ArgsType } = jest.requireActual("./args-type.decorator");
|
|
24
|
+
class SearchArgs {
|
|
25
|
+
}
|
|
26
|
+
ArgsType("NamedSearchArgs")(SearchArgs);
|
|
27
|
+
expect(store).toHaveBeenCalledWith(expect.any(Function));
|
|
28
|
+
expect(addArgsMetadata).toHaveBeenCalledTimes(2);
|
|
29
|
+
expect(addArgsMetadata).toHaveBeenCalledWith({
|
|
30
|
+
name: "NamedSearchArgs",
|
|
31
|
+
target: SearchArgs,
|
|
32
|
+
});
|
|
33
|
+
expect(addClassTypeMetadata).toHaveBeenCalledWith(SearchArgs, expect.any(String));
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
it("should default args metadata name to the target class name", () => {
|
|
37
|
+
const addArgsMetadata = jest.fn();
|
|
38
|
+
jest.isolateModules(() => {
|
|
39
|
+
jest.doMock("@nestjs/graphql/dist/schema-builder/storages/lazy-metadata.storage", () => ({
|
|
40
|
+
LazyMetadataStorage: {
|
|
41
|
+
store: jest.fn(),
|
|
42
|
+
},
|
|
43
|
+
}));
|
|
44
|
+
jest.doMock("@nestjs/graphql/dist/schema-builder/storages/type-metadata.storage", () => ({
|
|
45
|
+
TypeMetadataStorage: {
|
|
46
|
+
addArgsMetadata,
|
|
47
|
+
},
|
|
48
|
+
}));
|
|
49
|
+
jest.doMock("@nestjs/graphql/dist/utils/add-class-type-metadata.util", () => ({
|
|
50
|
+
addClassTypeMetadata: jest.fn(),
|
|
51
|
+
}));
|
|
52
|
+
const { ArgsType } = jest.requireActual("./args-type.decorator");
|
|
53
|
+
class DefaultNameArgs {
|
|
54
|
+
}
|
|
55
|
+
ArgsType()(DefaultNameArgs);
|
|
56
|
+
expect(addArgsMetadata).toHaveBeenCalledWith({
|
|
57
|
+
name: "DefaultNameArgs",
|
|
58
|
+
target: DefaultNameArgs,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=args-type.decorator.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args-type.decorator.spec.js","sourceRoot":"","sources":["../../src/decorators/args-type.decorator.spec.ts"],"names":[],"mappings":";AAAA,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,KAAK,GAAG,IAAI,C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,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACpE,MAAM,eAAe,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QAElC,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE;YACvB,IAAI,CAAC,MAAM,CACT,oEAAoE,EACpE,GAAG,EAAE,CAAC,CAAC;gBACL,mBAAmB,EAAE;oBACnB,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE;iBACjB;aACF,CAAC,CACH,CAAC;YACF,IAAI,CAAC,MAAM,CACT,oEAAoE,EACpE,GAAG,EAAE,CAAC,CAAC;gBACL,mBAAmB,EAAE;oBACnB,eAAe;iBAChB;aACF,CAAC,CACH,CAAC;YACF,IAAI,CAAC,MAAM,CACT,yDAAyD,EACzD,GAAG,EAAE,CAAC,CAAC;gBACL,oBAAoB,EAAE,IAAI,CAAC,EAAE,EAAE;aAChC,CAAC,CACH,CAAC;YAEF,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,aAAa,CAErC,uBAAuB,CAAC,CAAC;YAC3B,MAAM,eAAe;aAAG;YAExB,QAAQ,EAAE,CAAC,eAAe,CAAC,CAAC;YAE5B,MAAM,CAAC,eAAe,CAAC,CAAC,oBAAoB,CAAC;gBAC3C,IAAI,EAAE,iBAAiB;gBACvB,MAAM,EAAE,eAAe;aACxB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const common_1 = require("@nestjs/common");
|
|
4
|
+
const core_1 = require("@nestjs/core");
|
|
5
|
+
const testing_1 = require("@nestjs/testing");
|
|
6
|
+
const graphql_1 = require("graphql");
|
|
7
|
+
const graphql_exception_filter_1 = require("./graphql.exception-filter");
|
|
8
|
+
function createHost(type) {
|
|
9
|
+
return {
|
|
10
|
+
getType: jest.fn(() => type),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
describe("GraphQLExceptionFilter", () => {
|
|
14
|
+
const ORIGINAL_ENV = process.env;
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
process.env = {
|
|
17
|
+
...ORIGINAL_ENV,
|
|
18
|
+
NODE_ENV: "test",
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
afterEach(() => {
|
|
22
|
+
process.env = ORIGINAL_ENV;
|
|
23
|
+
jest.restoreAllMocks();
|
|
24
|
+
});
|
|
25
|
+
it("should return GraphQL errors unchanged", async () => {
|
|
26
|
+
const { filter } = await createFilter();
|
|
27
|
+
const error = new graphql_1.GraphQLError("already graphql");
|
|
28
|
+
expect(filter.transform(error)).toBe(error);
|
|
29
|
+
});
|
|
30
|
+
it("should transform HTTP exceptions with string responses", async () => {
|
|
31
|
+
const { filter } = await createFilter();
|
|
32
|
+
const error = filter.transform(new common_1.HttpException("bad input", common_1.HttpStatus.BAD_REQUEST));
|
|
33
|
+
expect(error.message).toBe("bad input");
|
|
34
|
+
expect(error.extensions).toMatchObject({
|
|
35
|
+
code: "BAD_REQUEST",
|
|
36
|
+
stack: expect.any(String),
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
it("should transform HTTP exceptions with object responses", async () => {
|
|
40
|
+
const { filter } = await createFilter();
|
|
41
|
+
expect(filter.transform(new common_1.BadRequestException({ reason: "bad reason" }))).toMatchObject({
|
|
42
|
+
message: "bad reason",
|
|
43
|
+
extensions: {
|
|
44
|
+
code: "BAD_REQUEST",
|
|
45
|
+
stack: expect.any(String),
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
expect(filter.transform(new common_1.BadRequestException({}))).toMatchObject({
|
|
49
|
+
message: "INTERNAL_SERVER_ERROR",
|
|
50
|
+
extensions: {
|
|
51
|
+
code: "BAD_REQUEST",
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
it("should hide internal errors in production", async () => {
|
|
56
|
+
process.env.NODE_ENV = "production";
|
|
57
|
+
const { filter } = await createFilter();
|
|
58
|
+
expect(filter.transform(new common_1.InternalServerErrorException("secret"))).toMatchObject({
|
|
59
|
+
message: "Internal server error",
|
|
60
|
+
extensions: {
|
|
61
|
+
code: "INTERNAL_SERVER_ERROR",
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
expect(filter.transform(new Error("secret"))).toMatchObject({
|
|
65
|
+
message: "Internal server error",
|
|
66
|
+
extensions: {
|
|
67
|
+
code: "INTERNAL_SERVER_ERROR",
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
it("should log and return transformed errors for GraphQL contexts", async () => {
|
|
72
|
+
const { errorLog, filter } = await createFilter();
|
|
73
|
+
const result = filter.catch(new Error("boom"), createHost("graphql"));
|
|
74
|
+
expect(result).toBeInstanceOf(graphql_1.GraphQLError);
|
|
75
|
+
expect(errorLog).toHaveBeenCalledWith("boom", {
|
|
76
|
+
err: result,
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
it("should log and delegate HTTP contexts to the base exception filter", async () => {
|
|
80
|
+
const { errorLog, filter } = await createFilter();
|
|
81
|
+
const baseCatch = jest
|
|
82
|
+
.spyOn(core_1.BaseExceptionFilter.prototype, "catch")
|
|
83
|
+
.mockImplementation();
|
|
84
|
+
const error = new Error("http boom");
|
|
85
|
+
const host = createHost("http");
|
|
86
|
+
expect(filter.catch(error, host)).toBeUndefined();
|
|
87
|
+
expect(errorLog).toHaveBeenCalledWith("http boom", {
|
|
88
|
+
err: error,
|
|
89
|
+
});
|
|
90
|
+
expect(baseCatch).toHaveBeenCalledWith(error, host);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
async function createFilter() {
|
|
94
|
+
const errorLog = jest.fn();
|
|
95
|
+
const moduleRef = await testing_1.Test.createTestingModule({
|
|
96
|
+
providers: [
|
|
97
|
+
graphql_exception_filter_1.GraphQLExceptionFilter,
|
|
98
|
+
{
|
|
99
|
+
provide: common_1.Logger,
|
|
100
|
+
useValue: {
|
|
101
|
+
error: errorLog,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
}).compile();
|
|
106
|
+
return {
|
|
107
|
+
errorLog,
|
|
108
|
+
filter: moduleRef.get(graphql_exception_filter_1.GraphQLExceptionFilter),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=graphql.exception-filter.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql.exception-filter.spec.js","sourceRoot":"","sources":["../src/graphql.exception-filter.spec.ts"],"names":[],"mappings":";;AAAA,2CAOwB;AACxB,uCAAmD;AACnD,6CAAuC;AACvC,qCAAuC;AAEvC,yEAAoE;AAEpE,SAAS,UAAU,CAAC,IAAwB;IAC1C,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;KACD,CAAC;AAChC,CAAC;AAED,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAEjC,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,CAAC,GAAG,GAAG;YACZ,GAAG,YAAY;YACf,QAAQ,EAAE,MAAM;SACjB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,GAAG,GAAG,YAAY,CAAC;QAC3B,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACtD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,YAAY,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,IAAI,sBAAY,CAAC,iBAAiB,CAAC,CAAC;QAElD,MAAM,CAAC,MAAM,CAAC,SAAS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,GAAG,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;QACrC,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAEhC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QAClD,MAAM,CAAC,QAAQ,CAAC,CAAC,oBAAoB,CAAC,WAAW,EAAE;YACjD,GAAG,EAAE,KAAK;SACX,CAAC,CAAC;QACH,MAAM,CAAC,SAAS,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,YAAY;IACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAC3B,MAAM,SAAS,GAAG,MAAM,cAAI,CAAC,mBAAmB,CAAC;QAC/C,SAAS,EAAE;YACT,iDAAsB;YACtB;gBACE,OAAO,EAAE,eAAM;gBACf,QAAQ,EAAE;oBACR,KAAK,EAAE,QAAQ;iBAChB;aACF;SACF;KACF,CAAC,CAAC,OAAO,EAAE,CAAC;IAEb,OAAO;QACL,QAAQ;QACR,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,iDAAsB,CAAC;KAC9C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const publicApi = __importStar(require("."));
|
|
37
|
+
const args_type_decorator_1 = require("./decorators/args-type.decorator");
|
|
38
|
+
const graphql_module_1 = require("./graphql.module");
|
|
39
|
+
describe("public API", () => {
|
|
40
|
+
it("should expose local and upstream GraphQL helpers", () => {
|
|
41
|
+
expect(publicApi.ArgsType).toBe(args_type_decorator_1.ArgsType);
|
|
42
|
+
expect(publicApi.GraphQLModule).toBe(graphql_module_1.GraphQLModule);
|
|
43
|
+
expect(publicApi.Plugin).toBeDefined();
|
|
44
|
+
expect(publicApi.Query).toBeDefined();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=index.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,0EAA4D;AAC5D,qDAAiD;AAEjD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,8BAAQ,CAAC,CAAC;QAC1C,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,8BAAa,CAAC,CAAC;QACpD,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;QACvC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|