local test_samurai = require("test-samurai") local core = require("test-samurai.core") describe("test-samurai core", function() before_each(function() test_samurai.setup() end) it("selects Go runner for _test.go files", function() local bufnr = vim.api.nvim_create_buf(false, true) vim.api.nvim_buf_set_name(bufnr, "/tmp/foo_test.go") local runner = core.get_runner_for_buf(bufnr) assert.is_not_nil(runner) assert.equals("go", runner.name) end) it("selects JS jest runner for *.test.ts files", function() local bufnr = vim.api.nvim_create_buf(false, true) vim.api.nvim_buf_set_name(bufnr, "/tmp/foo.test.ts") vim.bo[bufnr].filetype = "typescript" local runner = core.get_runner_for_buf(bufnr) assert.is_not_nil(runner) assert.equals("js-jest", runner.name) end) end)