Fix moduleNameMapper to not resolve .wasm.js
to .wasm
(#9894)
* Fix moduleNameMapper to not resolve `.wasm.js` to `.js` Fixes #9767 Undici [tries to import `./llhttp/llhttp.wasm.js`](e155c6db5c/lib/client.js (L342)
) which is currently broken by the (hacky) module name mapper. * longer timeout value * 30s * 50s * 60s to be safe * Revert "60s to be safe" This reverts commitf3e0f57962
. *2cc98226ca
revert? * revert * remove timeout * detectOpenHandles * Really solved? * Revert "detectOpenHandles" This reverts commit29214bdff8
. * Add `coveragePathIgnorePatterns` * Revert "Add `coveragePathIgnorePatterns`" This reverts commitfcf8c6806b
. * Import jsonld dynamically * remove import * add comment --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:

committed by
GitHub

parent
317770fb23
commit
9965bc8f94
@@ -1,6 +1,5 @@
|
||||
import * as crypto from 'node:crypto';
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import jsonld from 'jsonld';
|
||||
import { HttpRequestService } from '@/core/HttpRequestService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { CONTEXTS } from './misc/contexts.js';
|
||||
@@ -85,7 +84,9 @@ class LdSignature {
|
||||
@bindThis
|
||||
public async normalize(data: any) {
|
||||
const customLoader = this.getLoader();
|
||||
return await jsonld.normalize(data, {
|
||||
// XXX: Importing jsonld dynamically since Jest frequently fails to import it statically
|
||||
// https://github.com/misskey-dev/misskey/pull/9894#discussion_r1103753595
|
||||
return (await import('jsonld')).default.normalize(data, {
|
||||
documentLoader: customLoader,
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user