clanLib.jsonschema: move tests from pkgs/clan-cli

This commit is contained in:
DavHau
2023-08-09 16:05:16 +02:00
parent 9438a9eb5f
commit 7262208a4c
12 changed files with 38 additions and 28 deletions

View File

@@ -0,0 +1,20 @@
# tests for the nixos options to jsonschema converter
# run these tests via `nix-unit ./test.nix`
{ lib ? (import <nixpkgs> { }).lib
, slib ? import ./. { inherit lib; }
}:
let
evaledOptions =
let
evaledConfig = lib.evalModules {
modules = [ ./example-interface.nix ];
};
in
evaledConfig.options;
in
{
testParseOptions = {
expr = slib.parseOptions evaledOptions;
expected = builtins.fromJSON (builtins.readFile ./example-schema.json);
};
}