1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-11-28 06:48:32 +09:00
MisskeyIO/packages/backend/jest-resolver.cjs

15 lines
376 B
JavaScript
Raw Normal View History

2022-09-18 03:27:08 +09:00
// https://github.com/facebook/jest/issues/12270#issuecomment-1194746382
const nativeModule = require('node:module');
function resolver(module, options) {
const { basedir, defaultResolver } = options;
try {
return defaultResolver(module, options);
} catch (error) {
return nativeModule.createRequire(basedir).resolve(module);
}
}
module.exports = resolver;