From 35e62d2f53e0dcd667193cd374372349a7d06037 Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Fri, 20 Oct 2023 11:45:17 +0400 Subject: [PATCH] Added u-test report and code coverage --- .gitignore | 3 ++- jest.config.js | 10 ++++++++++ package.json | 3 ++- src/doc_controller.ts | 2 +- src/pdf_render/pdf_brick.ts | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8103b8b2..c26dc63d 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,5 @@ Gemfile.lock /doc_generator/*.json *.env package-lock.json -coverage/**/* \ No newline at end of file +coverage/**/* +junit.xml \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index 0fef332a..429a65d5 100644 --- a/jest.config.js +++ b/jest.config.js @@ -4,6 +4,16 @@ module.exports = { tsConfig: "tsconfig.test.json" } }, + reporters: [ + "default", + [ "jest-junit", { + "suiteNameTemplate": "{filepath}", + "outputDirectory": ".", + "outputName": "junit.xml" + } ] + ], + collectCoverage: true, + coverageReporters: ["json", "lcov", "text", "html", "text-summary", "cobertura"], roots: ["tests"], transform: { "^.+\\.(ts|tsx)?$": "ts-jest" diff --git a/package.json b/package.json index b8cf8e26..5812c9ad 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ "generate-json-webpack-plugin": "0.2.1", "husky": "^2.7.0", "jest": "^23.6.0", - "live-server": "1.2.0", + "jest-junit": "^16.0.0", + "live-server": "^1.2.2", "rimraf": "2.5.4", "standard-version": "^8.0.1", "surveyjs-doc-generator": "git+https://github.com/surveyjs/surveyjs-doc-generator.git", diff --git a/src/doc_controller.ts b/src/doc_controller.ts index 64ff91c6..9dec331e 100644 --- a/src/doc_controller.ts +++ b/src/doc_controller.ts @@ -211,7 +211,7 @@ export interface IDocOptions { isRTL?: boolean; /** * Specifies whether to include only selected choices when PDF Generator renders a [Multi-Select Dropdown (Tag Box)](https://surveyjs.io/form-library/examples/how-to-create-multiselect-tag-box/) question. - * + * * Default value: `false` (include all choices) */ tagboxSelectedChoicesOnly?: boolean; diff --git a/src/pdf_render/pdf_brick.ts b/src/pdf_render/pdf_brick.ts index a17df6f0..fea0a6f7 100644 --- a/src/pdf_render/pdf_brick.ts +++ b/src/pdf_render/pdf_brick.ts @@ -66,7 +66,7 @@ export class PdfBrick implements IPdfBrick { public fontSize: number; /** * The color of text within the brick. - * + * * Default value: `"#404040"` */ public textColor: string = SurveyHelper.TEXT_COLOR;