Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-ava-throws-helper

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-ava-throws-helper - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

6

index.js

@@ -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 @@ },

15

package.json
{
"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)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc