babel-plugin-tester
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -144,3 +144,3 @@ 'use strict'; | ||
if (typeof testConfig === 'string') { | ||
testConfig = { code: (0, _stripIndent2.default)(testConfig).trim() }; | ||
testConfig = { code: testConfig }; | ||
} | ||
@@ -160,4 +160,4 @@ var _testConfig = testConfig, | ||
title: fullTitle, | ||
code: code.trim(), | ||
output: output.trim() | ||
code: (0, _stripIndent2.default)(code).trim(), | ||
output: (0, _stripIndent2.default)(output).trim() | ||
}); | ||
@@ -164,0 +164,0 @@ } |
{ | ||
"name": "babel-plugin-tester", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Utilities for testing babel plugins", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -128,3 +128,3 @@ # babel-plugin-tester | ||
The rest of the options you provide will be [`lodash.merge`][lodash-merge]d | ||
The rest of the options you provide will be [`lodash.merge`][lodash.merge]d | ||
with each test object. Read more about those next! | ||
@@ -179,2 +179,4 @@ | ||
### Full Example + Docs | ||
```javascript | ||
@@ -267,2 +269,27 @@ import pluginTester from 'babel-plugin-tester' | ||
### Simple Example | ||
```javascript | ||
import pluginTester from 'babel-plugin-tester' | ||
import identifierReversePlugin from '../identifier-reverse-plugin' | ||
pluginTester({ | ||
plugin: identifierReversePlugin, | ||
snapshot: true, | ||
tests: [ | ||
{code: '"hello";', snapshot: false}, | ||
{ | ||
code: 'var hello = "hi";', | ||
output: 'var olleh = "hi";', | ||
}, | ||
` | ||
function sayHi(person) { | ||
return 'Hello ' + person + '!' | ||
} | ||
console.log(sayHi('Jenny')) | ||
`, | ||
], | ||
}) | ||
``` | ||
## Inspiration | ||
@@ -269,0 +296,0 @@ |
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
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
21989
356