babel-plugin-intuitional-test-stringify
v0.0.5
Published
> TODO: description
Downloads
4
Readme
babel-plugin-intuitional-test-stringify
The babel plugin for intuitional test ast stringify.
Usage
Default Options
- Input
// message
1 + 2 // => 3
- Output
var _looseEqual = require('assert').deepEqual
_looseEqual(1 + 2, 3, message)
Jest Style Options
{
"libraryTarget": "external",
"wrapTemplate": "it(MESSAGE, function() {return BODY});",
"libraryName": "expect",
"methodMapper": {
"looseNotEqual": "not.toEqual",
"looseEqual": "toEqual",
"strictEqual": "toBe",
"strictNotEqual": "not.toBe"
},
"expressionTemplate": "LIBRARY_NAME(ACTUAL).METHOD(EXPECTED)"
}
- Input
// message
1 + 2 // => 3
- Output
// message
it('message', function() {
return expect(1 + 2).toEqual(3)
}) // => 3
Options
libraryName
The assertion library name.
- Type:
string
- Default:
'assert'
libraryTarget
- Type:
'named' | 'external'
- Default:
'named'
expressionTemplate
The template for generating _looseEqual(1 + 2, 3, message);
from example.
- Type:
string
- Default:
'METHOD(ACTUAL, EXPECTED, MESSAGE);'
methodMapper
- Type:
{ strictEqual: string, looseEqual: string, looseNotEqual: string, strictNotEqual: string }
- Default:
{ strictEqual: 'strictEqual', looseEqual: 'deepEqual', looseNotEqual: 'notDeepEqual', strictNotEqual: 'notStrictEqual' }