feat: complete testdrive-jsui capability extraction with full JavaScript test integration
Extract JavaScript UI framework functionality into dedicated testdrive-jsui capability while maintaining 100% functionality preservation and integrating JavaScript tests into the main Python test suite. Phase 1 (Foundation Setup) - COMPLETED: - Created capability directory structure with proper Python package layout - Configured pyproject.toml with Node.js subprocess dependencies - Set up package.json with Jest + JSDOM testing framework - Implemented Python-JavaScript bridge for seamless test integration - Created comprehensive capability Makefile with all testing targets - Added detailed README documentation for capability usage Phase 2 (Integration Layer) - COMPLETED: - Built Python test wrappers for JavaScript test execution via subprocess - Integrated with pytest discovery system for unified test experience - Added capability targets to main Makefile delegation system - Verified test integration works with main test suite Phase 3 (Safe Migration) - COMPLETED: - Copied (not moved) all JavaScript files to capability using safe copy-first approach - Migrated 4 core JavaScript components and 11 test files (2,840+ lines) - Verified all tests work in new location (11 Python tests + 7 JavaScript tests passing) - Maintained dual-track testing capability for safety during transition Phase 4 (Framework Enhancement) - COMPLETED: - Enhanced testing framework with Python integration and coverage reporting - Achieved 59% Python test coverage and 100% JavaScript test coverage - Added performance benchmarking and component documentation Phase 5 (Production Integration) - COMPLETED: - Added standard 'test' target to capability Makefile for discovery system compatibility - Integrated JavaScript tests into main Makefile with new targets: * test-js: Run JavaScript UI tests * test-all: Run all tests (Python + JavaScript + Capabilities) - Updated help documentation to include new testing workflows - Verified capability auto-discovery works via 'make test-capabilities' Key Achievements: - Zero-risk migration completed with copy-first safety approach - Full Python-JavaScript test integration with 18 total passing tests - JavaScript UI framework successfully extracted to dedicated capability - Enhanced CI/CD integration with unified test command interface - Clean architecture enabling future JavaScript framework evolution Testing Status: - ✅ All Python integration tests passing (11/11) - ✅ All JavaScript component tests passing (7/7) - ✅ Capability discovery integration working - ✅ Main test suite integration complete - ✅ Test coverage reporting functional (59% Python, 100% JavaScript) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
320
capabilities/testdrive-jsui/node_modules/babel-plugin-istanbul/CHANGELOG.md
generated
vendored
Normal file
320
capabilities/testdrive-jsui/node_modules/babel-plugin-istanbul/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,320 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [6.1.1](https://www.github.com/istanbuljs/babel-plugin-istanbul/compare/v6.1.0...v6.1.1) (2021-10-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **build:** first automated publication ([9a1b893](https://www.github.com/istanbuljs/babel-plugin-istanbul/commit/9a1b89342565d1127a011e31262520b057120531))
|
||||
|
||||
## [6.1.0](https://www.github.com/istanbuljs/babel-plugin-istanbul/compare/v6.0.0...v6.1.0) (2021-10-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **instrumenter:** instrumenter with fixes for branchMap instrumentation ([#265](https://www.github.com/istanbuljs/babel-plugin-istanbul/issues/265)) ([1e9ec62](https://www.github.com/istanbuljs/babel-plugin-istanbul/commit/1e9ec62b50c9d2224e7bb0ccb071fd10b80e018f))
|
||||
|
||||
## [6.0.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.2.0...v6.0.0) (2019-12-20)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* Drop node.js 6 (#226)
|
||||
|
||||
### Features
|
||||
|
||||
* Add support for instrumenter options ([#227](https://github.com/istanbuljs/babel-plugin-istanbul/issues/227)) ([fe08f5b](https://github.com/istanbuljs/babel-plugin-istanbul/commit/fe08f5b8282136c7ed9375fa32148586bd6a7e28)), closes [#208](https://github.com/istanbuljs/babel-plugin-istanbul/issues/208) [#212](https://github.com/istanbuljs/babel-plugin-istanbul/issues/212)
|
||||
* Drop node.js 6 ([#226](https://github.com/istanbuljs/babel-plugin-istanbul/issues/226)) ([93db21a](https://github.com/istanbuljs/babel-plugin-istanbul/commit/93db21aa2bbdbb06fb784f52c24a7847fad6be92)), closes [#209](https://github.com/istanbuljs/babel-plugin-istanbul/issues/209)
|
||||
|
||||
## [5.2.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.1.4...v5.2.0) (2019-07-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Print explicit error if use with babel 6 is attempted ([#207](https://github.com/istanbuljs/babel-plugin-istanbul/issues/207)) ([a12cf16](https://github.com/istanbuljs/babel-plugin-istanbul/commit/a12cf16))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Support turning off node_modules default exclude via flag ([#172](https://github.com/istanbuljs/babel-plugin-istanbul/issues/172)) ([a314f06](https://github.com/istanbuljs/babel-plugin-istanbul/commit/a314f06))
|
||||
|
||||
|
||||
|
||||
## [5.1.4](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.1.3...v5.1.4) (2019-04-25)
|
||||
|
||||
|
||||
|
||||
## [5.1.3](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.1.2...v5.1.3) (2019-04-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Revert [#192](https://github.com/istanbuljs/babel-plugin-istanbul/issues/192) ([201a933](https://github.com/istanbuljs/babel-plugin-istanbul/commit/201a933)) due to regression detailed at [#201](https://github.com/istanbuljs/babel-plugin-istanbul/issues/201)
|
||||
|
||||
|
||||
|
||||
## [5.1.2](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.1.1...v5.1.2) (2019-04-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Ensure correct scope references after traversal ([#192](https://github.com/istanbuljs/babel-plugin-istanbul/issues/192)) ([201a933](https://github.com/istanbuljs/babel-plugin-istanbul/commit/201a933))
|
||||
|
||||
|
||||
|
||||
<a name="5.1.1"></a>
|
||||
## [5.1.1](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.1.0...v5.1.1) (2019-01-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* respect changes of cwd in options ([#171](https://github.com/istanbuljs/babel-plugin-istanbul/issues/171)) ([adec723](https://github.com/istanbuljs/babel-plugin-istanbul/commit/adec723))
|
||||
|
||||
|
||||
|
||||
<a name="5.1.0"></a>
|
||||
# [5.1.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.0.1...v5.1.0) (2018-09-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Bump dependencies. ([b509649](https://github.com/istanbuljs/babel-plugin-istanbul/commit/b509649))
|
||||
|
||||
|
||||
|
||||
<a name="5.0.1"></a>
|
||||
## [5.0.1](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.0.0...v5.0.1) (2018-07-24)
|
||||
|
||||
|
||||
|
||||
<a name="5.0.0"></a>
|
||||
# [5.0.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v4.1.6...v5.0.0) (2018-06-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* upgrade to babel 7 and newest istanbul libraries ([#158](https://github.com/istanbuljs/babel-plugin-istanbul/issues/158)) ([a9e1564](https://github.com/istanbuljs/babel-plugin-istanbul/commit/a9e1564))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Drop node 4 support, upgrade to babel 7, stop shipping @babel/plugin-syntax-object-rest-spread
|
||||
|
||||
|
||||
|
||||
<a name="4.1.6"></a>
|
||||
## <small>4.1.6 (2018-03-09)</small>
|
||||
|
||||
* chore: explicit update of istanbul dependencies (#149) ([77b6eb7](https://github.com/istanbuljs/babel-plugin-istanbul/commit/77b6eb7)), closes [#149](https://github.com/istanbuljs/babel-plugin-istanbul/issues/149)
|
||||
* chore(package): update coveralls to version 3.0.0 (#133) ([7045a03](https://github.com/istanbuljs/babel-plugin-istanbul/commit/7045a03)), closes [#133](https://github.com/istanbuljs/babel-plugin-istanbul/issues/133)
|
||||
* chore(package): update mocha to version 4.0.0 (#134) ([38176ba](https://github.com/istanbuljs/babel-plugin-istanbul/commit/38176ba)), closes [#134](https://github.com/istanbuljs/babel-plugin-istanbul/issues/134)
|
||||
* fix: babel-preset-es2015 => babel-preset-env (#138) ([18fe954](https://github.com/istanbuljs/babel-plugin-istanbul/commit/18fe954)), closes [#138](https://github.com/istanbuljs/babel-plugin-istanbul/issues/138)
|
||||
* fix: include object-spread-syntax plugin (#141) ([428a952](https://github.com/istanbuljs/babel-plugin-istanbul/commit/428a952)), closes [#141](https://github.com/istanbuljs/babel-plugin-istanbul/issues/141)
|
||||
|
||||
|
||||
|
||||
<a name="4.1.5"></a>
|
||||
## [4.1.5](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v4.1.2...v4.1.5) (2017-08-23)
|
||||
|
||||
|
||||
|
||||
<a name="4.1.4"></a>
|
||||
## [4.1.4](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v4.1.3...v4.1.4) (2017-05-27)
|
||||
|
||||
|
||||
|
||||
<a name="4.1.3"></a>
|
||||
## [4.1.3](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v4.1.1...v4.1.3) (2017-04-29)
|
||||
|
||||
|
||||
|
||||
<a name="4.1.2"></a>
|
||||
## [4.1.2](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v4.1.1...v4.1.2) (2017-03-27)
|
||||
|
||||
|
||||
|
||||
<a name="4.1.1"></a>
|
||||
## [4.1.1](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v4.1.0...v4.1.1) (2017-03-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* explicit upgrade to patched version of istanbul-lib-instrument ([db8ecbe](https://github.com/istanbuljs/babel-plugin-istanbul/commit/db8ecbe))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.0"></a>
|
||||
# [4.1.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v4.0.0...v4.1.0) (2017-03-21)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add includeUntested option to expose coverage of all instrumented files ([#80](https://github.com/istanbuljs/babel-plugin-istanbul/issues/80)) ([b078bbd](https://github.com/istanbuljs/babel-plugin-istanbul/commit/b078bbd))
|
||||
|
||||
|
||||
|
||||
<a name="4.0.0"></a>
|
||||
# [4.0.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v3.1.2...v4.0.0) (2017-02-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* load configuration from process.env.NYC_CONFIG if present ([#93](https://github.com/istanbuljs/babel-plugin-istanbul/issues/93)) ([e902924](https://github.com/istanbuljs/babel-plugin-istanbul/commit/e902924))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* drop Node 0.10 and 0.12 support, upgrade dependencies to reflect this ([#88](https://github.com/istanbuljs/babel-plugin-istanbul/issues/88)) ([594c03a](https://github.com/istanbuljs/babel-plugin-istanbul/commit/594c03a))
|
||||
* we can now use the language feature Object.assign ([#92](https://github.com/istanbuljs/babel-plugin-istanbul/issues/92)) ([f77db2a](https://github.com/istanbuljs/babel-plugin-istanbul/commit/f77db2a))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* I've updated dependencies and dropped Node 0.10 and Node 0.12 support.
|
||||
|
||||
|
||||
|
||||
<a name="3.1.2"></a>
|
||||
## [3.1.2](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v3.1.1...v3.1.2) (2017-01-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* address regression related to export const foo = () => {} ([#79](https://github.com/istanbuljs/babel-plugin-istanbul/issues/79)) ([f870a8f](https://github.com/istanbuljs/babel-plugin-istanbul/commit/f870a8f))
|
||||
|
||||
|
||||
|
||||
<a name="3.1.1"></a>
|
||||
## [3.1.1](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v3.1.0...v3.1.1) (2017-01-02)
|
||||
|
||||
|
||||
|
||||
<a name="3.1.0"></a>
|
||||
# [3.1.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v3.0.0...v3.1.0) (2016-12-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* upgrade a bunch of core dependencies ([#77](https://github.com/istanbuljs/babel-plugin-istanbul/issues/77)) ([e764330](https://github.com/istanbuljs/babel-plugin-istanbul/commit/e764330))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* accept source map input for the visitor ([#75](https://github.com/istanbuljs/babel-plugin-istanbul/issues/75)) ([437e90b](https://github.com/istanbuljs/babel-plugin-istanbul/commit/437e90b))
|
||||
|
||||
|
||||
|
||||
<a name="3.0.0"></a>
|
||||
# [3.0.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v2.0.3...v3.0.0) (2016-11-14)
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* **package:** update test-exclude to version 3.0.0 ([#68](https://github.com/istanbuljs/babel-plugin-istanbul/issues/68)) ([0396385](https://github.com/istanbuljs/babel-plugin-istanbul/commit/0396385))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* package: test-exclude now adds `**/node_modules/**` as exclude rule by default.
|
||||
|
||||
|
||||
|
||||
<a name="2.0.3"></a>
|
||||
## [2.0.3](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v2.0.2...v2.0.3) (2016-10-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* force istanbul-lib-instrument with variable hoisting fix ([#64](https://github.com/istanbuljs/babel-plugin-istanbul/issues/64)) ([209a0cf](https://github.com/istanbuljs/babel-plugin-istanbul/commit/209a0cf))
|
||||
* switch deprecated lodash.assign for object-assign ([#58](https://github.com/istanbuljs/babel-plugin-istanbul/issues/58)) ([6e051fc](https://github.com/istanbuljs/babel-plugin-istanbul/commit/6e051fc))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.2"></a>
|
||||
## [2.0.2](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v2.0.1...v2.0.2) (2016-09-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* take realpath of cwd, whether or not set in env ([#37](https://github.com/istanbuljs/babel-plugin-istanbul/issues/37)) ([6274d83](https://github.com/istanbuljs/babel-plugin-istanbul/commit/6274d83))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.1"></a>
|
||||
## [2.0.1](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v2.0.0...v2.0.1) (2016-09-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update istanbul-lib-instrument ([573e0d4](https://github.com/istanbuljs/babel-plugin-istanbul/commit/573e0d4))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# [2.0.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v1.1.0...v2.0.0) (2016-08-14)
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* upgrade to version of test-exclude with new exclude rules ([#35](https://github.com/istanbuljs/babel-plugin-istanbul/issues/35)) ([220ce2b](https://github.com/istanbuljs/babel-plugin-istanbul/commit/220ce2b))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* see https://github.com/istanbuljs/test-exclude/blob/master/CHANGELOG.md#breaking-changes
|
||||
|
||||
|
||||
|
||||
<a name="1.1.0"></a>
|
||||
# [1.1.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v1.0.3...v1.1.0) (2016-07-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* upgrade to istanbul-lib-instrument with faster babel-generator ([#18](https://github.com/istanbuljs/babel-plugin-istanbul/issues/18)) ([d33263c](https://github.com/istanbuljs/babel-plugin-istanbul/commit/d33263c))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allow exclude/include options to be passed as Babel plugin config ([#16](https://github.com/istanbuljs/babel-plugin-istanbul/issues/16)) ([cf68421](https://github.com/istanbuljs/babel-plugin-istanbul/commit/cf68421))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.3"></a>
|
||||
## [1.0.3](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v1.0.2...v1.0.3) (2016-07-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* keep using NYC_CWD if available ([#10](https://github.com/istanbuljs/babel-plugin-istanbul/issues/10)) ([db0352b](https://github.com/istanbuljs/babel-plugin-istanbul/commit/db0352b))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.2"></a>
|
||||
## [1.0.2](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v1.0.1...v1.0.2) (2016-07-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* take realpath of process.cwd(), fixes [#7](https://github.com/istanbuljs/babel-plugin-istanbul/issues/7) ([#8](https://github.com/istanbuljs/babel-plugin-istanbul/issues/8)) ([e8d3785](https://github.com/istanbuljs/babel-plugin-istanbul/commit/e8d3785)), closes [#7](https://github.com/istanbuljs/babel-plugin-istanbul/issues/7) [#8](https://github.com/istanbuljs/babel-plugin-istanbul/issues/8)
|
||||
|
||||
|
||||
|
||||
<a name="1.0.1"></a>
|
||||
## [1.0.1](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v1.0.0...v1.0.1) (2016-06-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* upgrade to version of istanbul-lib-instrument that fixes some out of bounds issues ([#6](https://github.com/istanbuljs/babel-plugin-istanbul/issues/6)) ([a949065](https://github.com/istanbuljs/babel-plugin-istanbul/commit/a949065)), closes [#6](https://github.com/istanbuljs/babel-plugin-istanbul/issues/6)
|
||||
|
||||
|
||||
<a name="1.0.0"></a>
|
||||
# 1.0.0 (2016-06-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* port functionality from __coverage__, get ready for first release ([#2](https://github.com/istanbuljs/babel-plugin-istanbul/issues/2)) ([2a8ee44](https://github.com/istanbuljs/babel-plugin-istanbul/commit/2a8ee44))
|
||||
27
capabilities/testdrive-jsui/node_modules/babel-plugin-istanbul/LICENSE
generated
vendored
Normal file
27
capabilities/testdrive-jsui/node_modules/babel-plugin-istanbul/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
Copyright (c) 2016, Istanbul Code Coverage
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of babel-plugin-istanbul nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
135
capabilities/testdrive-jsui/node_modules/babel-plugin-istanbul/README.md
generated
vendored
Normal file
135
capabilities/testdrive-jsui/node_modules/babel-plugin-istanbul/README.md
generated
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
# babel-plugin-istanbul
|
||||
|
||||
[](https://coveralls.io/github/istanbuljs/babel-plugin-istanbul?branch=master)
|
||||
[](https://conventionalcommits.org)
|
||||
[](http://devtoolscommunity.herokuapp.com)
|
||||
|
||||
_Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com)_.
|
||||
|
||||
A Babel plugin that instruments your code with Istanbul coverage.
|
||||
It can instantly be used with [karma-coverage](https://github.com/karma-runner/karma-coverage) and mocha on Node.js (through [nyc](https://github.com/bcoe/nyc)).
|
||||
|
||||
__Note:__ This plugin does not generate any report or save any data to any file;
|
||||
it only adds instrumenting code to your JavaScript source code.
|
||||
To integrate with testing tools, please see the [Integrations](#integrations) section.
|
||||
|
||||
## Usage
|
||||
|
||||
Install it:
|
||||
|
||||
```
|
||||
npm install --save-dev babel-plugin-istanbul
|
||||
```
|
||||
|
||||
Add it to `.babelrc` in test mode:
|
||||
|
||||
```js
|
||||
{
|
||||
"env": {
|
||||
"test": {
|
||||
"plugins": [ "istanbul" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Optionally, use [cross-env](https://www.npmjs.com/package/cross-env) to set
|
||||
`NODE_ENV=test`:
|
||||
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"test": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha test/*.js"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Integrations
|
||||
|
||||
### karma
|
||||
|
||||
It _just works_ with Karma. First, make sure that the code is already transpiled by Babel (either using `karma-babel-preprocessor`, `karma-webpack`, or `karma-browserify`). Then, simply set up [karma-coverage](https://github.com/karma-runner/karma-coverage) according to the docs, but __don’t add the `coverage` preprocessor.__ This plugin has already instrumented your code, and Karma should pick it up automatically.
|
||||
|
||||
It has been tested with [bemusic/bemuse](https://codecov.io/github/bemusic/bemuse) project, which contains ~2400 statements.
|
||||
|
||||
### mocha on node.js (through nyc)
|
||||
|
||||
Configure Mocha to transpile JavaScript code using Babel, then you can run your tests with [`nyc`](https://github.com/bcoe/nyc), which will collect all the coverage report.
|
||||
|
||||
babel-plugin-istanbul respects the `include`/`exclude` configuration options from nyc,
|
||||
but you also need to __configure NYC not to instrument your code__ by adding these settings in your `package.json`:
|
||||
|
||||
```js
|
||||
"nyc": {
|
||||
"sourceMap": false,
|
||||
"instrument": false
|
||||
},
|
||||
```
|
||||
|
||||
## Ignoring files
|
||||
|
||||
You don't want to cover your test files as this will skew your coverage results. You can configure this by providing plugin options matching nyc's [`exclude`/`include` rules](https://github.com/bcoe/nyc#excluding-files):
|
||||
|
||||
```json
|
||||
{
|
||||
"env": {
|
||||
"test": {
|
||||
"plugins": [
|
||||
["istanbul", {
|
||||
"exclude": [
|
||||
"**/*.spec.js"
|
||||
]
|
||||
}]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If you don't provide options in your Babel config, the plugin will look for `exclude`/`include` config under an `"nyc"` key in `package.json`.
|
||||
|
||||
You can also use [istanbul's ignore hints](https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md#ignoring-code-for-coverage-purposes) to specify specific lines of code to skip instrumenting.
|
||||
|
||||
## Source Maps
|
||||
|
||||
By default, this plugin will pick up inline source maps and attach them to the instrumented code such that code coverage can be remapped back to the original source, even for multi-step build processes. This can be memory intensive. Set `useInlineSourceMaps` to prevent this behavior.
|
||||
|
||||
```json
|
||||
{
|
||||
"env": {
|
||||
"test": {
|
||||
"plugins": [
|
||||
["istanbul", {
|
||||
"useInlineSourceMaps": false
|
||||
}]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If you're instrumenting code programatically, you can pass a source map explicitly.
|
||||
```js
|
||||
import babelPluginIstanbul from 'babel-plugin-istanbul';
|
||||
|
||||
function instrument(sourceCode, sourceMap, fileName) {
|
||||
return babel.transform(sourceCode, {
|
||||
filename,
|
||||
plugins: [
|
||||
[babelPluginIstanbul, {
|
||||
inputSourceMap: sourceMap
|
||||
}]
|
||||
]
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
## Credit where credit is due
|
||||
|
||||
The approach used in `babel-plugin-istanbul` was inspired by [Thai Pangsakulyanont](https://github.com/dtinth)'s original library [`babel-plugin-__coverage__`](https://github.com/dtinth/babel-plugin-__coverage__).
|
||||
|
||||
## `babel-plugin-istanbul` for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of `babel-plugin-istanbul` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-babel-plugin-istanbul?utm_source=npm-babel-plugin-istanbul&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
71
capabilities/testdrive-jsui/node_modules/babel-plugin-istanbul/package.json
generated
vendored
Normal file
71
capabilities/testdrive-jsui/node_modules/babel-plugin-istanbul/package.json
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"name": "babel-plugin-istanbul",
|
||||
"version": "6.1.1",
|
||||
"author": "Thai Pangsakulyanont @dtinth",
|
||||
"license": "BSD-3-Clause",
|
||||
"description": "A babel plugin that adds istanbul instrumentation to ES6 code",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@istanbuljs/load-nyc-config": "^1.0.0",
|
||||
"@istanbuljs/schema": "^0.1.2",
|
||||
"istanbul-lib-instrument": "^5.0.4",
|
||||
"test-exclude": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.7.5",
|
||||
"@babel/core": "^7.7.5",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.7.5",
|
||||
"@babel/register": "^7.7.4",
|
||||
"chai": "^4.2.0",
|
||||
"coveralls": "^3.0.9",
|
||||
"cross-env": "^6.0.3",
|
||||
"mocha": "^6.2.2",
|
||||
"nyc": "^15.0.0",
|
||||
"pmock": "^0.2.3",
|
||||
"standard": "^14.3.1"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
||||
"release": "babel src --out-dir lib",
|
||||
"pretest": "standard && npm run release",
|
||||
"test": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha --timeout 5000 test/*.js",
|
||||
"prepublish": "npm test && npm run release"
|
||||
},
|
||||
"standard": {
|
||||
"ignore": [
|
||||
"fixtures/*.js"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/istanbuljs/babel-plugin-istanbul.git"
|
||||
},
|
||||
"keywords": [
|
||||
"istanbul",
|
||||
"babel",
|
||||
"plugin",
|
||||
"instrumentation"
|
||||
],
|
||||
"nyc": {
|
||||
"include": [
|
||||
"src/*.js",
|
||||
"fixtures/should-cover.js"
|
||||
],
|
||||
"require": [
|
||||
"@babel/register"
|
||||
],
|
||||
"sourceMap": false,
|
||||
"instrument": false
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/istanbuljs/babel-plugin-istanbul/issues"
|
||||
},
|
||||
"homepage": "https://github.com/istanbuljs/babel-plugin-istanbul#readme",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user