测试执行后,我在控制台得到结果。现在我需要HTML格式的相同结果。我们如何得到HTML报告格式的测试结果?
ttisahbt1#
您可以添加jest-html-reporter:
jest-html-reporter
{ "name": "api_ts_tests", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "tsc" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "@types/jest": "^29.5.3", "axios": "^1.4.0", "jest": "^29.6.2", "jest-html-reporter": "^3.10.2", "ts-jest": "^29.1.1", "typescript": "^5.2.2" }, "dependencies": { "@actions/core": "^1.10.1", "@actions/github": "^5.1.1", "js-yaml": "^4.1.0" }, "jest": { "transform": { "^.+\\.ts$": "ts-jest" }, "testMatch": [ "**/?(*.)+(spec|test).[t]s?(x)" ], "reporters": [ "default", [ "./node_modules/jest-html-reporter", { "pageTitle": "Test Report" } ] ] } }
字符串调整html报告的参数列表-> https://github.com/Hargne/jest-html-reporter/wiki/configuration#list-of-configuration-options
1条答案
按热度按时间ttisahbt1#
您可以添加
jest-html-reporter
:字符串
调整html报告的参数列表-> https://github.com/Hargne/jest-html-reporter/wiki/configuration#list-of-configuration-options