@tsed/cli-plugin-jest 3.19.6 → 3.20.2
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.
|
@@ -13,7 +13,7 @@ let JestGenerateHook = class JestGenerateHook {
|
|
|
13
13
|
{
|
|
14
14
|
title: `Generate ${ctx.type} spec file to '${symbolPath}.spec.ts'`,
|
|
15
15
|
enabled() {
|
|
16
|
-
return !(ctx.type === "server" || ctx.type.includes(":connection"));
|
|
16
|
+
return !(ctx.type === "server" || ctx.type.includes(":dataSource") || ctx.type.includes(":connection"));
|
|
17
17
|
},
|
|
18
18
|
task: () => this.srcRenderService.render(specTemplate, { ...ctx, relativeSrcPath }, {
|
|
19
19
|
output: `${symbolPath}.spec.ts`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JestGenerateHook.js","sourceRoot":"","sources":["../../src/hooks/JestGenerateHook.ts"],"names":[],"mappings":";;;;AACA,6CAAqF;AACrF,sDAAkD;AAElD,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAGhD,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAK3B,cAAc,CAAC,GAAuB;QACpC,MAAM,EAAC,UAAU,EAAC,GAAG,GAAG,CAAC;QACzB,MAAM,EAAC,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAC,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAElF,OAAO;YACL;gBACE,KAAK,EAAE,YAAY,GAAG,CAAC,IAAI,kBAAkB,UAAU,WAAW;gBAClE,OAAO;oBACL,OAAO,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"JestGenerateHook.js","sourceRoot":"","sources":["../../src/hooks/JestGenerateHook.ts"],"names":[],"mappings":";;;;AACA,6CAAqF;AACrF,s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A2B;QAC5C,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAE5E,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,YAAY,IAAI,WAAW,EAAE,EAAC,WAAW,EAAE,0BAAY,EAAC,CAAC;YACjH,CAAC,CAAC,YAAY,IAAI,WAAW;YAC7B,CAAC,CAAC,2BAA2B,CAAC;QAEhC,MAAM,mBAAmB,GAAG,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,YAAY,IAAI,kBAAkB,EAAE,EAAC,WAAW,EAAE,0BAAY,EAAC,CAAC;YAC/H,CAAC,CAAC,YAAY,IAAI,kBAAkB;YACpC,CAAC,CAAC,kCAAkC,CAAC;QAEvC,OAAO;YACL,YAAY;YACZ,mBAAmB;YACnB,eAAe,EAAE,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,UAAU,sBAAsB,CAAC,CAAC;SAChH,CAAC;IACJ,CAAC;CACF,CAAA;AA1DC;IADC,iBAAM,EAAE;sCACS,6BAAkB;0DAAC;AAGrC;IADC,iBAAM,CAAC,UAAU,CAAC;;;;sDAqClB;AAzCU,gBAAgB;IAD5B,qBAAU,EAAE;GACA,gBAAgB,CA4D5B;AA5DY,4CAAgB","sourcesContent":["import {GenerateCmdContext} from \"@tsed/cli\";\nimport {Inject, Injectable, OnExec, SrcRendererService, Tasks} from \"@tsed/cli-core\";\nimport {TEMPLATE_DIR} from \"../utils/templateDir\";\n\nconst normalizePath = require(\"normalize-path\");\n\n@Injectable()\nexport class JestGenerateHook {\n @Inject()\n srcRenderService: SrcRendererService;\n\n @OnExec(\"generate\")\n onGenerateExec(ctx: GenerateCmdContext): Tasks {\n const {symbolPath} = ctx;\n const {specTemplate, integrationTemplate, relativeSrcPath} = this.mapOptions(ctx);\n\n return [\n {\n title: `Generate ${ctx.type} spec file to '${symbolPath}.spec.ts'`,\n enabled() {\n return !(ctx.type === \"server\" || ctx.type.includes(\":dataSource\") || ctx.type.includes(\":connection\"));\n },\n task: () =>\n this.srcRenderService.render(\n specTemplate,\n {...ctx, relativeSrcPath},\n {\n output: `${symbolPath}.spec.ts`,\n templateDir: TEMPLATE_DIR\n }\n )\n },\n {\n title: `Generate ${ctx.type} integration file '${symbolPath}.integration.spec.ts'`,\n enabled() {\n return [\"controller\", \"server\"].includes(ctx.type);\n },\n task: () =>\n this.srcRenderService.render(\n integrationTemplate,\n {...ctx, relativeSrcPath},\n {\n output: `${symbolPath}.integration.spec.ts`,\n templateDir: TEMPLATE_DIR\n }\n )\n }\n ];\n }\n\n private mapOptions(options: GenerateCmdContext) {\n const type = [options.type, options.templateType].filter(Boolean).join(\".\");\n\n const specTemplate = this.srcRenderService.templateExists(`generate/${type}.spec.hbs`, {templateDir: TEMPLATE_DIR})\n ? `generate/${type}.spec.hbs`\n : \"generate/generic.spec.hbs\";\n\n const integrationTemplate = this.srcRenderService.templateExists(`generate/${type}.integration.hbs`, {templateDir: TEMPLATE_DIR})\n ? `generate/${type}.integration.hbs`\n : \"generate/generic.integration.hbs\";\n\n return {\n specTemplate,\n integrationTemplate,\n relativeSrcPath: normalizePath(this.srcRenderService.relativeFrom(`${options.symbolPath}.integration.spec.ts`))\n };\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/cli-plugin-jest",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.2",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"typings": "./lib/index.d.ts",
|
|
6
6
|
"description": "Ts.ED CLI plugin. Add Jest support",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"@tsed/cli": "3.
|
|
9
|
-
"@tsed/cli-core": "3.
|
|
8
|
+
"@tsed/cli": "3.20.2",
|
|
9
|
+
"@tsed/cli-core": "3.20.2"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsc --build tsconfig.compile.json",
|