# karma-source-map-support

> Karma plugin for inline sourcemap support

Latest version **1.4.0** (published 2019-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install karma-source-map-support
pnpm add karma-source-map-support
yarn add karma-source-map-support
bun add karma-source-map-support
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2019-02-08 |
| First published | 2015-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tim Schaub |
| Maintainers | tschaub |
| Keywords | karma-plugin, karma-framework, browserify, inline, sourcemap |

## Links

- npm: https://www.npmjs.com/package/karma-source-map-support
- Repository: https://github.com/tschaub/karma-source-map-support
- Issues: https://github.com/tschaub/karma-source-map-support/issues
- npm.io page: https://npm.io/package/karma-source-map-support

## Dependencies (1)

- [source-map-support](https://npm.io/package/source-map-support.md) ^0.5.5

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.4.0 (latest) — 2019-02-08
- 1.3.0 — 2018-05-08
- 1.2.0 — 2016-08-30
- 1.1.0 — 2015-08-01
- 1.0.0 — 2015-01-02

## README

# karma-source-map-support

[![Greenkeeper badge](https://badges.greenkeeper.io/tschaub/karma-source-map-support.svg)](https://greenkeeper.io/)

Karma plugin for inline sourcemap support.

## Motivation

When loading Browserify bundles with inline source maps (via [`karma-browserify`](https://www.npmjs.com/package/karma-browserify)), the stack traces in Chrome don't mention the original modules.  This plugin uses [`source-map-support`](https://www.npmjs.com/package/source-map-support) to improve the situation.

## Use

Install the plugin with `npm`:

    npm install karma-source-map-support

Configure Karma to load the plugin as a framework:

```js
module.exports = function(config) {
  config.set({
    frameworks: ['source-map-support']
    // additional settings here ...
  });
};
```

## Example

The config settings below are a complete example using Mocha and Browserify with source map support:

```js
module.exports = function(config) {
  config.set({
    frameworks: ['browserify', 'source-map-support', 'mocha'],
    files: [
      'src/**/*.test.js'
    ],
    preprocessors: {
      'src/**/*.test.js': ['browserify']
    },
    browsers: ['PhantomJS'],
    singleRun: false,
    browserify: {
      debug: true // include inline source maps
    }
  });
};
```

Sample stack trace without this plugin:
```
AssertionError: case 2: expected [ 0, 0.6666666666666666 ] to deeply equal [ 0, 0.5 ]
    at Function.assert.deepEqual (http://localhost:9876/absolute/var/folders/6m/3grlt52x7w3047wy0n6j7dr00000gn/T/2d4c510ad9122153a42db199d1cc8e9553208184.browserify:1848:32)
    at Context.<anonymous> (http://localhost:9876/absolute/var/folders/6m/3grlt52x7w3047wy0n6j7dr00000gn/T/2d4c510ad9122153a42db199d1cc8e9553208184.browserify:6061:14)
    at callFn (http://localhost:9876/base/node_modules/mocha/mocha.js:4496:21)
    at Test.Runnable.run (http://localhost:9876/base/node_modules/mocha/mocha.js:4489:7)
    at Runner.runTest (http://localhost:9876/base/node_modules/mocha/mocha.js:4892:10)
    at http://localhost:9876/base/node_modules/mocha/mocha.js:4970:12
    at next (http://localhost:9876/base/node_modules/mocha/mocha.js:4817:14)
    at http://localhost:9876/base/node_modules/mocha/mocha.js:4827:7
    at next (http://localhost:9876/base/node_modules/mocha/mocha.js:4766:23)
    at http://localhost:9876/base/node_modules/mocha/mocha.js:4794:5
```


Sample stack trace with this plugin:
```
AssertionError: case 2: expected [ 0, 0.6666666666666666 ] to deeply equal [ 0, 0.5 ]
    at Function.assert.deepEqual (node_modules/chai/lib/chai/interface/assert.js:205:1)
    at Context.<anonymous> (src/scenes/util/geom.test.js:27:1)
    at callFn (http://localhost:9876/base/node_modules/mocha/mocha.js:4496:21)
    at Test.Runnable.run (http://localhost:9876/base/node_modules/mocha/mocha.js:4489:7)
    at Runner.runTest (http://localhost:9876/base/node_modules/mocha/mocha.js:4892:10)
    at http://localhost:9876/base/node_modules/mocha/mocha.js:4970:12
    at next (http://localhost:9876/base/node_modules/mocha/mocha.js:4817:14)
    at http://localhost:9876/base/node_modules/mocha/mocha.js:4827:7
    at next (http://localhost:9876/base/node_modules/mocha/mocha.js:4766:23)
    at http://localhost:9876/base/node_modules/mocha/mocha.js:4794:5
```

---
_Source: https://npm.io/package/karma-source-map-support · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
