Skip to content

IonutInit/test-it

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published