{"id":16861064,"url":"https://github.com/sergei-startsev/karma-stacktrace","last_synced_at":"2025-09-15T02:30:46.443Z","repository":{"id":143882203,"uuid":"94022717","full_name":"sergei-startsev/karma-stacktrace","owner":"sergei-startsev","description":"Provides human-readable sourcemapped stacktrace for running tests in a browser.","archived":false,"fork":false,"pushed_at":"2024-06-20T11:23:33.000Z","size":456,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-28T14:46:51.692Z","etag":null,"topics":["jasmine","qunit","sourcemaps","stacktrace"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sergei-startsev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-11T18:07:25.000Z","updated_at":"2022-08-27T21:20:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"70f43a8d-c304-4c9c-89ca-69e0c355e133","html_url":"https://github.com/sergei-startsev/karma-stacktrace","commit_stats":{"total_commits":55,"total_committers":4,"mean_commits":13.75,"dds":0.1454545454545455,"last_synced_commit":"d5c12072ddeebee54d6ad1b2d2adfe2776ca184d"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergei-startsev%2Fkarma-stacktrace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergei-startsev%2Fkarma-stacktrace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergei-startsev%2Fkarma-stacktrace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergei-startsev%2Fkarma-stacktrace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergei-startsev","download_url":"https://codeload.github.com/sergei-startsev/karma-stacktrace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233063460,"owners_count":18619392,"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":["jasmine","qunit","sourcemaps","stacktrace"],"created_at":"2024-10-13T14:29:02.795Z","updated_at":"2025-01-08T16:49:03.797Z","avatar_url":"https://github.com/sergei-startsev.png","language":"JavaScript","readme":"# karma-stacktrace\n\n![actions](https://github.com/sergei-startsev/karma-stacktrace/workflows/Node%20CI/badge.svg)\n![npm](https://img.shields.io/npm/v/karma-stacktrace)\n![GitHub](https://img.shields.io/github/license/sergei-startsev/karma-stacktrace)\n\n## What\n\nKarma framework to provide human-readable mapped stacktraces for failed tests to make debugging easier in your browser.\n\n## Motivation\n\nTest frameworks like [QUnit](https://qunitjs.com/) and [Jasmine](http://jasmine.github.io/) use [non-standard](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) `stack` property of `Error` object to output a stacktrace for failed unit tests.\nModern browsers do not apply sourcemaps to `Error.prototype.stack` and unmapped stacktrace looks useless.\n\nAn example of an unmapped stacktrace:\n\n![Original stacktrace](./stacktrace-original.png 'Original stacktrace')\n\nThe framework catches failed tests and reports mapped stacktrace by using [stacktrace-js](https://www.stacktracejs.com/) library:\n\n![Mapped stacktrace](./stacktrace-mapped.png 'Mapped stacktrace')\n\n## Install\n\nInstall with `yarn`:\n\n`yarn add karma-stacktrace`\n\nWith `npm`:\n\n`npm install karma-stacktrace`\n\n## Karma configuration\n\nAdd `stacktrace` to the list of frameworks in your karma configuration:\n\n```js\n// karma.conf.js\nmodule.exports = function (config) {\n  config.set({\n    //...\n    frameworks: ['stacktrace']\n    //...\n  });\n};\n```\n\nTo avoid blocking the main execution thread [web worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is used by default for parsing/mapping stacktrace,\nhowever you can disable it by setting `useWorker` option to `false`:\n\n```js\n// karma.conf.js\nmodule.exports = function (config) {\n  config.set({\n    //...\n    client: {\n      stacktrace: {\n        useWorker: false\n      }\n    }\n    //...\n  });\n};\n```\n\nIf you use inline sourcemaps (`devtool: 'inline-source-map'`) you need to disable the web worker.\n\n## Limitations/Gotchas\n\n- The framework supports [Jasmine](http://jasmine.github.io/) and [QUnit](https://qunitjs.com/) testing frameworks.\n- The framework **does not affect** stacktrace in original messages, it attaches isolated reporters to trace mapped stacktrace.\n- Set `useWorker` option to `false` value for inline sourcemaps to get mapped stacktrace.\n\n## Examples\n\nSee the [karma configuration example](https://github.com/sergei-startsev/karma-stacktrace/tree/master/examples) used with webpack 5 configured to emit external sourcemaps (`devtool: 'source-map'`).\n\n## Inspired by\n\n- [sourcemapped-stacktrace](https://github.com/novocaine/sourcemapped-stacktrace)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergei-startsev%2Fkarma-stacktrace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergei-startsev%2Fkarma-stacktrace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergei-startsev%2Fkarma-stacktrace/lists"}