Simple test fixtures backed by inline source maps and source map files
npm install source-map-fixturesSimple test fixtures backed by inline source maps and source map files. Can be
used to test code that needs to resolve or apply source maps.
The fixtures should work in Node.js 0.10 and up. Generating fixtures requires
some ES2015 features, Node.js 5 or up is recommended.
```
npm install --save-dev source-map-fixtures
Source maps will only change between major versions. New fixtures or other
features may be added in minor releases.
See src/branching.js. Exports a run(value) function which returns true ifvalue === 42, else returns undefined.
Like branching, but the if condition is prefaced with a / istanbul ignore if /
comment.
When running branching with value !== 42 the statement body won't execute.istanbul-ignore
If you're using the fixture to test a code coverage tool that line will show up
as missing coverage. If instead you use the fixture the
coverage report will ignore the statement body.
If the exported run(value) is called with a value other than 42 thebranching
statement body won't execute, but this does not result in missing coverage. It
would in the fixture.
See src/simple.js. Exports a run() function which returns 42.
See src/throws.js. Exports a run() function which returns throws an error.
See src/bundle.js. Bundled version of the above fixtures, exportsbranching(value), istanbulIgnore(), simple() etc.
The source map is included inside the fixture source.
The source map is provided as a separate file, referenced by the fixture source.
No source map is provided.
`js`
const fixtures = require('source-map-fixtures')
Use fixtures.inline(name), fixtures.mapFile(name) and fixtures.none(name),name
where is one of branching, simple, etc. This returns a fixture
object:
`js`
const fixture = require('source-map-fixtures').inline('simple')
Provides the name of the fixture.
Provides the source map type of the fixture (inline, map-file, none`).
Provides the full path to the fixture file.
Provides the full path to the fixture's source file.
Requires the fixture file (returns it as a module).
Synchronously reads the fixture file's content from disk.
Synchronously reads the fixture's source's content from disk.