New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

karma-stacktrace

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-stacktrace

Provides human-readable sourcemapped stacktrace for karma running in a browser.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.4K
decreased by-20.39%
Maintainers
1
Weekly downloads
 
Created
Source

karma-stacktrace

What

This is a karma framework for providing human-readable sourcemapped stacktraces in a browser.

Why

Popular test frameworks (Jasmine, QUnit) uses non-standard stack property of Error objects to output a trace when unit tests fail for some reasons. Stacktraces are intended to assist in understanding causes of failed tests, but they become useless without applied sourcemaps. Modern browsers support sourcemaps when viewing stacktraces from errors in their native console, but there is no support for applying sourcemaps to the Error.prototype.stack.

Exampled of an unmapped stacktrace for a failed test:

Unmapped stacktrace

The framework is designed to catch failed tests and provide sourcemapped stacktraces by using stacktrace-js library. It also clears stacktraces from usually useless traces of a testing framework. At the same time it does not affect original stacktraces.

Mapped stacktrace

How

Install

npm install karma-stacktrace

Karma configuraton

Add stacktrace to a list of frameworks in a corresponding karma configuration:

//karma.conf.js
module.exports = function(config) {
  config.set({
    //...
    frameworks: ['stacktrace'],
    //...
  });
};

Limitations

  • At the moment the framework supports only Jasmine and QUnit testing frameworks.
  • The framework attaches isolated reporters to provide sourcemapped stacktraces, so it does not affect original stacktraces.

Inspired by

Keywords

FAQs

Package last updated on 11 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc