@ionutinit/test-it
v0.1.0
Published
Syntactic shortcut to basic jest tests. Made for personal use and for testing npm.
Downloads
1
Readme
Syntactic shortcut to basic jest tests. Made for personal use and for testing npm.
Syntax
const tests = [
[
[<input params>], <expected result>,
{
// overrides global function settings
type?: string,
description?: string,
}
]
]
testIt(
<function>, tests
{
type?: string,
description?: string,
}
)
Currently supported types
*defaults to equal*
| Type | Jest method | | ----------- | -------------------------------------- | | be | toBe | | equal | toEqual | | error | toThrowError | | hasProperty | toHaveProperty | | warn | toHaveBeenCalledWith <console, "warn"> |