jsonnet-libs / testonnet

A unit testing framework for Jsonnet.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Testonnet

A unit test framework for Jsonnet. This library is inspired by jsonnetunit, it follows the object-oriented approach.

Install

jb install github.com/jsonnet-libs/testonnet@master

Usage

local test = import "github.com/jsonnet-libs/testonnet/main.libsonnet";

local fact(n) = if n == 0 then 1 else n * fact(n - 1);

test.new(std.thisFile)
+ test.case.new(
  name='Fact',
  test=test.expect.eq(
    actual=fact(10),
    expected=3628800
  )
)

More docs in docs/README.md.

About

A unit testing framework for Jsonnet.

License:Apache License 2.0


Languages

Language:Jsonnet 97.7%Language:Makefile 2.3%