Skip to content

Commit 8d210a0

Browse files
committed
Update mustache templates
1 parent 6b8d9ec commit 8d210a0

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/main/resources/mustache/typescript-fetch/api_test.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe("{{classname}}", () => {
1414
{{#operation}}
1515
test("{{operationId}}", () => {
1616
{{#allParams}}
17-
const {{{paramName}}}: {{^isPrimitiveType}}api.{{/isPrimitiveType}}{{{dataType}}} = {{#example}}{{#isString}}"{{{example}}}"{{/isString}}{{^isString}}{{{example}}}{{/isString}}{{/example}}{{^example}}undefined{{/example}}
17+
const {{{paramName}}}: {{^isPrimitiveType}}api.{{/isPrimitiveType}}{{{dataType}}} = {{>api_test_default_value}}
1818
{{/allParams}}
1919
expect(instance.{{operationId}}({{#allParams}}{{{paramName}}}, {{/allParams}}{})).toBe(null)
2020
})

src/main/resources/mustache/typescript-fetch/package.mustache

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"typings": "./dist/index.d.ts",
1515
"scripts" : {
1616
"build": "tsc --outDir dist/",
17+
"test": "jest",
1718
"prepublishOnly": "npm run build"
1819
},
1920
"dependencies": {
@@ -23,9 +24,16 @@
2324
"@types/jest": "^25.2.1",
2425
"@types/node": "^13.13.0",
2526
"jest": "^25.4.0",
27+
"ts-jest": "^25.4.0",
2628
"typescript": "^3.8.3"
27-
}{{#npmRepository}},{{/npmRepository}}
28-
{{#npmRepository}}
29+
},
30+
"jest": {
31+
"transform": {
32+
"^.+\\.tsx?$": "ts-jest"
33+
},
34+
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
35+
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"]
36+
}{{#npmRepository}},
2937
"publishConfig":{
3038
"registry":"{{npmRepository}}"
3139
}

src/main/resources/mustache/typescript-fetch/tsconfig.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
},
1515
"exclude": [
1616
"dist",
17-
"node_modules"
17+
"node_modules",
18+
"**/*.spec.ts"
1819
]
1920
}

0 commit comments

Comments
 (0)