diff --git a/flake-modules/tests.nix b/flake-modules/tests.nix index 8601b7da..9251965b 100644 --- a/flake-modules/tests.nix +++ b/flake-modules/tests.nix @@ -3,13 +3,14 @@ pkgs, config, system, + helpers, makeNixvimWithModuleUnfree, makeNixvimWithModule, ... }: { checks = { tests = import ../tests { - inherit pkgs; + inherit pkgs helpers; inherit (pkgs) lib; makeNixvim = configuration: makeNixvimWithModuleUnfree { @@ -25,7 +26,7 @@ }; lib-tests = import ../tests/lib-tests.nix { - inherit pkgs; + inherit pkgs helpers; inherit (pkgs) lib; }; }; diff --git a/tests/default.nix b/tests/default.nix index 404b231a..632cafee 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -1,6 +1,7 @@ { makeNixvim, lib, + helpers, pkgs, }: let fetchTests = import ./fetch-tests.nix; @@ -9,7 +10,7 @@ # List of files containing configurations testFiles = fetchTests { - inherit lib pkgs; + inherit lib pkgs helpers; root = ./test-sources; }; diff --git a/tests/fetch-tests.nix b/tests/fetch-tests.nix index 8008d601..d2f73fc4 100644 --- a/tests/fetch-tests.nix +++ b/tests/fetch-tests.nix @@ -2,6 +2,7 @@ root, lib, pkgs, + helpers, }: let # Handle an entry from readDir and either extract the configuration if its a regular file, # or continue to recurse if it's a directory. While recursing maintain a list of the traversed @@ -35,7 +36,6 @@ # Remove the nesting testsList = lib.lists.flatten (parseDirectories root []); - helpers = import ../lib/helpers.nix {inherit lib;}; testsListEvaluated = builtins.map ({ cases, namespace, diff --git a/tests/lib-tests.nix b/tests/lib-tests.nix index c8ad9fc5..e1b13c57 100644 --- a/tests/lib-tests.nix +++ b/tests/lib-tests.nix @@ -3,8 +3,8 @@ { lib, pkgs, + helpers, }: let - helpers = import ../lib/helpers.nix {inherit lib pkgs;}; results = pkgs.lib.runTests { testToLuaObject = { expr = helpers.toLuaObject {