babel-plugin-ava-throws-helper
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -38,2 +38,7 @@ 'use strict'; | ||
var arg0 = path.node.arguments[0]; | ||
if (!(arg0 && arg0.loc && (typeof arg0.start === 'number') && (typeof arg0.end === 'number'))) { | ||
return; | ||
} | ||
path.node.arguments[0] = wrapWithHelper({ | ||
@@ -66,2 +71,3 @@ HELPER_ID: t.identifier(this.avaThrowHelper()), | ||
} | ||
return HELPER_ID; | ||
@@ -68,0 +74,0 @@ }, |
{ | ||
"name": "babel-plugin-ava-throws-helper", | ||
"version": "0.0.4", | ||
"description": "My cool module", | ||
"version": "0.0.5", | ||
"description": "Babel plugin for protecting against improper use of `t.throws()` in AVA", | ||
"license": "MIT", | ||
"repository": "jamestalmage/babel-plugin-throws-helper", | ||
"repository": "avajs/babel-plugin-throws-helper", | ||
"author": { | ||
@@ -23,3 +23,8 @@ "name": "James Talmage", | ||
"keywords": [ | ||
"" | ||
"babel-plugin", | ||
"babel", | ||
"helper", | ||
"ava", | ||
"assertion", | ||
"throws" | ||
], | ||
@@ -33,4 +38,4 @@ "dependencies": { | ||
"babel-core": "^6.7.5", | ||
"xo": "^0.13.0" | ||
"xo": "^0.15.1" | ||
} | ||
} |
@@ -1,8 +0,8 @@ | ||
# babel-plugin-ava-throws-helper [![Build Status](https://travis-ci.org/jamestalmage/babel-plugin-throws-helper.svg?branch=master)](https://travis-ci.org/jamestalmage/babel-plugin-throws-helper) | ||
# babel-plugin-ava-throws-helper [![Build Status](https://travis-ci.org/avajs/babel-plugin-ava-throws-helper.svg?branch=master)](https://travis-ci.org/avajs/babel-plugin-ava-throws-helper) | ||
> internal AVA internal plugin for protecting against improper use of `t.throws` | ||
> Babel plugin for protecting against improper use of `t.throws()` in [AVA](https://ava.li) | ||
Probably not useful except as an internal plugin for the AVA test runner. | ||
Genesis of the idea: https://github.com/sindresorhus/eslint-plugin-ava/issues/75 | ||
[Genesis of the idea.](https://github.com/sindresorhus/eslint-plugin-ava/issues/75) | ||
@@ -15,9 +15,9 @@ ## Issue | ||
The difficulty is that `t.throws(foo())` is allowed if `foo()` returns a promise or a function. There is no good way to differentiate between the two at runtime. So providing a good error message is going to take some AST transform magic. | ||
## The solution | ||
See `example-output.md` for the transformation this performs. | ||
## Solution | ||
See [`example-output.md`](example-output.md) for the transformation this plugin performs. | ||
The example output can be generated by calling: | ||
@@ -31,4 +31,5 @@ | ||
## License | ||
MIT © [James Talmage](http://github.com/jamestalmage) | ||
MIT © [James Talmage](https://github.com/jamestalmage) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
5477
76
34