{"id":22139167,"url":"https://github.com/lenvonsam/jest-vue-report","last_synced_at":"2025-04-10T12:04:48.598Z","repository":{"id":57280514,"uuid":"133628467","full_name":"lenvonsam/jest-vue-report","owner":"lenvonsam","description":"A Jest test framework combined with Vuejs to render the test report, and a good combination with the nightmare","archived":false,"fork":false,"pushed_at":"2018-05-25T13:54:22.000Z","size":47,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T10:51:45.322Z","etag":null,"topics":["e2e-tests","jest-nightmare-report","jest-reporter","unit-tests","vue-report-template"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lenvonsam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-16T07:37:50.000Z","updated_at":"2020-01-02T00:24:45.000Z","dependencies_parsed_at":"2022-09-11T22:41:06.255Z","dependency_job_id":null,"html_url":"https://github.com/lenvonsam/jest-vue-report","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lenvonsam%2Fjest-vue-report","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lenvonsam%2Fjest-vue-report/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lenvonsam%2Fjest-vue-report/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lenvonsam%2Fjest-vue-report/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lenvonsam","download_url":"https://codeload.github.com/lenvonsam/jest-vue-report/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248216367,"owners_count":21066629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["e2e-tests","jest-nightmare-report","jest-reporter","unit-tests","vue-report-template"],"created_at":"2024-12-01T20:13:53.025Z","updated_at":"2025-04-10T12:04:48.580Z","avatar_url":"https://github.com/lenvonsam.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jest-Vue-Report\n\n\u003e A Jest test framework combined with Vuejs to render the test report, and a good combination with the nightmare\n\n![Downloads](screenshot/jest_vue_report_shot.png)\n![Downloads](screenshot/jest_vue_report_shot2.png)\n\n## Getting Started\n\nInstall it via npm:\n\n```shell\nnpm install jest-vue-report\n```\n\nAnd include in your jest project: (If not Jest Project, you can follow [this doc](https://github.com/lenvonsam/vue-jest-test/wiki/1%E3%80%81%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B) to build it as fast as your can)\n\n\nThe reporter integrates with Jest in form of a [testResultsProcessor](https://facebook.github.io/jest/docs/api.html#testresultsprocessor-string). Put this into your projects `package.json`:\n\n```\n\"jest\": {\n  \"testResultsProcessor\": \"jest-vue-report\"\n}\n```\nThen can also config custom report site, e.g. put this in your `package.json`, **(default site -\u003e `\u003croot\u003e/test/jestReport` )**\n```\n\"jest-vue-report\": {\n  \"report-site\": \"test/vueReport\"\n}\n```\nWith customer config, the test report will auto genente to `\u003croot\u003e/test/vueReport`\n\nThen, just use Jest as usual, e.g. put this in your `package.json`\n\n```\n\"scripts\": {\n  \"test\": \"jest\"\n}\n```\nThen, simply run `npm test`\n\n#### Important note:\n\n**Built files are meant to be served over an HTTP server.**\n\nThen, you should go to the reporter folder and use [http-server](https://www.npmjs.com/package/http-server) to build an HTTP server conveniently.\n\n\n## ONE MORE IMPORTANT\n\nThere is a good combination of the nightmare screenshots with jest-vue-report\n\n\u003e Example\n\njest test file\n```js\nimport Nightmare from 'nightmare'\nimport { getScreenshotUrl } from 'jest-vue-report'\n\njest.setTimeout(15000)\n\ndescribe('Login', () =\u003e {\n  let page = null\n  var path = require('path')\n  beforeEach(() =\u003e {\n    page = Nightmare({show: true}).viewport(1024, 768)\n    page.goto('http://www.xingyun361.com')\n  })\n  it('should login with failure', async () =\u003e {\n    await page\n      .click('.btn.login_btn1.l')\n      .wait('#username_0')\n      .click('#login_bt')\n      .wait('#area_error_msg')\n    await  page.screenshot(getScreenshotUrl('should login with failure'))\n    const content = await page.wait('#area_error_msg')\n      .evaluate(() =\u003e document.querySelector('#area_error_msg').innerHTML).end()\n    await page.end()\n    console.log('content:\u003e\u003e' + content)\n    expect(content).toBe('请输入用户名')\n  })\n})\n```\n\n\u003e Note: **unitName in `getScreenshotUrl(unitName)` should be unique name.**\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flenvonsam%2Fjest-vue-report","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flenvonsam%2Fjest-vue-report","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flenvonsam%2Fjest-vue-report/lists"}