adrigzr / neotest-mocha

Neotest runner for Mocha test framework
9 stars 9 forks source link

Configurable test patterns #2

Closed MisanthropicBit closed 1 year ago

MisanthropicBit commented 1 year ago

As discussed in #1, this PR adds the ability to configure the file extensions for test files. I also added a utility function create_test_file_extensions_matcher for easily creating a matcher from a set of file extensions as in:

local neotest = require('neotest')
local mocha_util = require('neotest-mocha.util')

neotest.setup({
  is_test_file = mocha_util.create_test_file_extensions_matcher(
    { 'spec', 'test' },
    { 'js', 'mjs', 'cjs', 'jsx', 'coffee', 'ts', 'tsx' }
  ),
})
MisanthropicBit commented 1 year ago

@adrigzr Did you have a chance to look at this?

adrigzr commented 1 year ago

@MisanthropicBit sorry! Didn't get a notification for this. Looks good to me :) Thanks for your contribution.

MisanthropicBit commented 1 year ago

No problem, thanks for getting back to me :)