Skip to content

Commit e4ea007

Browse files
committed
add .mts support
1 parent ca673bf commit e4ea007

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/configuration/from_file.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ async function loadFile(
105105
)
106106
definitions = await import(pathToFileURL(filePath).toString())
107107
break
108+
case '.mts':
109+
logger.debug(
110+
`Loading configuration file "${file}" as ESM TypeScript based on extension`
111+
)
112+
definitions = await import(pathToFileURL(filePath).toString())
113+
break
108114
case '.js':
109115
{
110116
const parentPackage = await readPackageJson(filePath)

src/configuration/from_file_spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,16 @@ p1:
220220
expect(result).to.deep.eq({ paths: ['other/path/*.feature'] })
221221
})
222222

223+
it('should work with .mts', async () => {
224+
const { logger, cwd } = await setup(
225+
'cucumber.mts',
226+
`export default {}; export const p1 = {paths: ['other/path/*.feature']}`
227+
)
228+
229+
const result = await fromFile(logger, cwd, 'cucumber.mts', ['p1'])
230+
expect(result).to.deep.eq({ paths: ['other/path/*.feature'] })
231+
})
232+
223233
it('should throw for an unsupported format', async () => {
224234
const { logger, cwd } = await setup('cucumber.foo', `{}`)
225235
try {

0 commit comments

Comments
 (0)