diff --git a/config/nvim/lua/plugins/projectionist.lua b/config/nvim/lua/plugins/projectionist.lua index 99802987..3d16e281 100644 --- a/config/nvim/lua/plugins/projectionist.lua +++ b/config/nvim/lua/plugins/projectionist.lua @@ -49,12 +49,19 @@ vim.g.projectionist_heuristics = { ['*.ts'] = { alternate = { '{dirname}/{basename}.test.ts', - '{dirname}/{basename}.test.tsx', + '{dirname}/{basename}.__tests__.ts', '{dirname}/__tests__/{basename}.test.ts', - '{dirname}/__tests__/{basename}.test.tsx', }, type = 'source', }, + ['*.__tests__.ts'] = { + alternate = { '{dirname}/{basename}.ts', '{dirname}/../{basename}.ts' }, + type = 'test', + }, + ['*.__tests__.tsx'] = { + alternate = { '{dirname}/{basename}.tsx', '{dirname}/../{basename}.tsx' }, + type = 'test', + }, ['*.test.ts'] = { alternate = { '{dirname}/{basename}.ts', @@ -66,9 +73,8 @@ vim.g.projectionist_heuristics = { }, ['*.tsx'] = { alternate = { - '{dirname}/{basename}.test.ts', '{dirname}/{basename}.test.tsx', - '{dirname}/__tests__/{basename}.test.ts', + '{dirname}/{basename}.__tests__.tsx', '{dirname}/__tests__/{basename}.test.tsx', }, type = 'source',