Fix test
This commit is contained in:
parent
e298316df7
commit
681548038d
|
@ -57,7 +57,7 @@ export function createWordMuteInfo(mutedWords: Array<string | string[]>) : WordM
|
|||
};
|
||||
}
|
||||
|
||||
function setWordMuteInfo(mutedWords: Array<string | string[]>, hardMutedWords: Array<string | string[]>): void {
|
||||
export function setWordMuteInfo(mutedWords: Array<string | string[]>, hardMutedWords: Array<string | string[]>): void {
|
||||
const soft = createWordMuteInfo(mutedWords);
|
||||
const hard = createWordMuteInfo(hardMutedWords);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
import { describe, test, assert } from 'vitest';
|
||||
import { createWordMuteInfo, checkWordMute } from '@/utility/check-word-mute.js';
|
||||
import { checkWordMute, setWordMuteInfo } from '@/utility/check-word-mute.js';
|
||||
import { NoteMock } from './mocks.js';
|
||||
|
||||
type TestCases = {
|
||||
|
@ -63,10 +63,7 @@ describe('check-word-mute', () => {
|
|||
cases.forEach((c) => {
|
||||
test(`text: ${c.text}, cw: ${c.cw}, mutedWords: ${c.mutedWords}` , async () => {
|
||||
// initWordMuteInfoが実行されないので代わりにここで初期化
|
||||
(globalThis as any)._misskeyWordMute = {
|
||||
soft: createWordMuteInfo(c.mutedWords),
|
||||
hard: createWordMuteInfo([]),
|
||||
}
|
||||
setWordMuteInfo(c.mutedWords, []);
|
||||
|
||||
const note = NoteMock({ text: c.text, cw: c.cw });
|
||||
const result = checkWordMute(note, null, 'soft');
|
||||
|
|
Loading…
Reference in New Issue