Skip to content
This repository has been archived by the owner on Dec 31, 2019. It is now read-only.

Commit

Permalink
chore(release): v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil committed Feb 16, 2015
1 parent 61853e3 commit 623ff7f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ But can customize the babel options thanks to my [fork](https://github.com/dougl

```js

var to5Options = { experimental: true };
var babelOptions = { experimental: true };

// [...]

Expand All @@ -62,7 +62,7 @@ coverageReporter: {
'**/*.js': 'isparta'
},
instrumenterOptions: {
isparta: { to5 : to5Options }
isparta: { babel : babelOptions }
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var Instrumenter = require("./instrumenter").Instrumenter;
nomnom.command("cover").help("transparently adds coverage information to a node command. Saves coverage.json and reports at the end of execution").option("cmd", {
required: true,
position: 1,
help: "ES6 js files to cover (using 6to5)"
help: "ES6 js files to cover (using babel)"
}).option("config", {
metavar: "<path-to-config>",
help: "the configuration file to use, defaults to .istanbul.yml"
Expand Down
12 changes: 6 additions & 6 deletions lib/instrumenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var _classCallCheck = function (instance, Constructor) { if (!(instance instance

var istanbul = _interopRequire(require("istanbul"));

var to5 = _interopRequire(require("6to5-core"));
var babel = _interopRequire(require("babel-core"));

var esprima = _interopRequire(require("esprima"));

Expand All @@ -29,8 +29,8 @@ var Instrumenter = exports.Instrumenter = (function (_istanbul$Instrumenter) {
var options = arguments[0] === undefined ? {} : arguments[0];
_classCallCheck(this, Instrumenter);

this.to5Options = _extends({
sourceMap: true }, options && options.to5 || {});
this.babelOptions = _extends({
sourceMap: true }, options && options.babel || {});

istanbul.Instrumenter.call(this, options);
}
Expand All @@ -40,8 +40,8 @@ var Instrumenter = exports.Instrumenter = (function (_istanbul$Instrumenter) {
_prototypeProperties(Instrumenter, null, {
instrumentSync: {
value: function instrumentSync(code, fileName) {
var result = this._r = to5.transform(code, _extends({}, this.to5Options, { filename: fileName }));
this._6to5Map = new SourceMapConsumer(result.map);
var result = this._r = babel.transform(code, _extends({}, this.babelOptions, { filename: fileName }));
this._babelMap = new SourceMapConsumer(result.map);

// PARSE
var program = esprima.parse(result.code, {
Expand Down Expand Up @@ -113,7 +113,7 @@ var Instrumenter = exports.Instrumenter = (function (_istanbul$Instrumenter) {
var lastLine = 1;

["start", "end"].forEach(function (k) {
loc[k] = _this._6to5Map.originalPositionFor(loc[k]);
loc[k] = _this._babelMap.originalPositionFor(loc[k]);
if (loc[k].source == null) {
_this._skipLocation(loc);
return false;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "isparta",
"version": "1.4.2",
"version": "2.0.0",
"description": "A code coverage tool for ES6 (babel)",
"main": "./lib/isparta",
"keywords": [
Expand Down

0 comments on commit 623ff7f

Please sign in to comment.