#!/bin/bash # Run tests with Neovim context LUA_PATH="./lua/?.lua;./lua/?/init.lua;$LUA_PATH" nvim --headless -c " -- Mock minimal vim global for testing _G.vim = { fn = { stdpath = function(type) return '/tmp/notex_test' end, getpid = function() return 12345 end, }, loop = { fs_stat = function(path) return {type = 'file', size = 100} end, timer_start = function(delay, callback) return 1 end, timer_stop = function(timer_id) -- Mock timer stop end, }, uv = { new_timer = function() return { start = function() end, stop = function() end, close = function() end } end, hrtime = function() return os.clock() * 1e9 end, }, trim = function(str) return str:match('^%s*(.-)%s*$') end, split = function(str, sep) local fields = {} local pattern = string.format('([^%s]+)', sep) str:gsub(pattern, function(c) fields[#fields + 1] = c end) return fields end, tbl_contains = function(t, val) for _, v in ipairs(t) do if v == val then return true end end return false end, } -- Run busted local busted = require('busted') local args = {'$@'} busted.run(args) " -c "qa"