Forest Logo
search
package_2

jest-each

By @roblox

Roblox

Mirrored from Wally

jest-each

Upstream: https://github.com/facebook/jest/tree/v27.4.7/packages/jest-each

A parameterized testing library for Jest. You can find its documentation in the Jest documentation.


:pencil2: Notes

  • Deviations:
    • Tagged templates are not available in Lua. As an alternative, a headings string must be used with a list of arrays containing the same amount of items as headings. Example:
    each("a | b | expected",
        { 0, 0, 0 },
        { 0, 1, 1 },
        { 1, 1, 2 }
    ).it("returns $expected when given $a and $b",
        function(ref)
            local a: number, b: number, expected = ref.a, ref.b, ref.expected
            jestExpect(a + b).toBe(expected)
        end
    )
    
    • Use NIL provided constant instead of nil when passing values to each
    each("expected", { NIL }).it(
    	"templates properly convert $expected to nil before running the tests",
    	function(ref)
    		jestExpect(ref.expected).toBe(nil)
    	end
    )
    
    • TestEZ methods are supported (*FOCUS, *SKIP), however, these may be dropped at some point in favor of jest's callable objects(it, it.only, it.skip), which are supported too

Package Details

Install command (Click to copy)


Version

3.20.1

License

MIT

check_circle

Safe for commercial use

infoThe package archive does not include its license text; the license is declared in its manifest metadata.

Automated license review — not legal advice.