From 20ac4575caf552f6494767b755273e397b296888 Mon Sep 17 00:00:00 2001 From: Jongwook Choi Date: Mon, 25 Sep 2023 22:44:49 -0400 Subject: [PATCH] feat(test_harness): Add opts to test_harness.test_file PROBLEM: There was no way to configure opts (such as init, minimal, etc.) for running a single file test (`test_harness.test_file(file)`). SOLUTION: Add `opts` parameter. --- lua/plenary/test_harness.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/plenary/test_harness.lua b/lua/plenary/test_harness.lua index a548db71..993fb54b 100644 --- a/lua/plenary/test_harness.lua +++ b/lua/plenary/test_harness.lua @@ -193,8 +193,9 @@ function harness.test_directory(directory, opts) test_paths(paths, opts) end -function harness.test_file(filepath) - test_paths { Path:new(filepath) } +function harness.test_file(filepath, opts) + local paths = { Path:new(filepath) } + test_paths(paths, opts) end function harness._find_files_to_run(directory)