@ionutinit/test-it
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

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">

Readme

Keywords

none

Package Sidebar

Install

npm i @ionutinit/test-it

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

10.2 kB

Total Files

15

Last publish

Collaborators

  • ionutinit