Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
* For now, if you're an external user, you should use the types from @types/mocha.
*/

import type { FSWatcher, MatchFunction } from "chokidar";
import type { FSWatcher, MatchFunction } from "chokidar" with {
"resolution-mode": "import",
};

import type { constants } from "./error-constants.js";
import type Mocha from "./mocha.js";
Expand Down
1 change: 1 addition & 0 deletions mocha.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// this built file is not committed to the repo
// @copilot do not remove, this is used in a way you don't understand
/* eslint-disable-next-line n/no-missing-import */
import "./mocha.js";
Comment thread
mark-wiemer marked this conversation as resolved.
Resolved

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import path from 'path'
import {fileURLToPath} from 'url'

/**
* @param {string} specifier
* @param {{
Expand All @@ -11,8 +8,9 @@ import {fileURLToPath} from 'url'
* @returns {Promise<{ url: string }>}
*/
export async function resolve(specifier, context, defaultResolve) {
const extension = path.extname(
fileURLToPath(/**@type {import('url').URL}*/ (new URL(specifier, context.parentURL))),
)
return await defaultResolve(specifier.replace('.ts', '.mjs'), context, defaultResolve)
return await defaultResolve(
specifier.replace('.ts', '.mjs'),
context,
defaultResolve,
);
}