summaryrefslogtreecommitdiff
path: root/benches
diff options
context:
space:
mode:
Diffstat (limited to 'benches')
-rw-r--r--benches/translator.bench.js15
1 files changed, 3 insertions, 12 deletions
diff --git a/benches/translator.bench.js b/benches/translator.bench.js
index 1231c31c..8b9b5118 100644
--- a/benches/translator.bench.js
+++ b/benches/translator.bench.js
@@ -20,8 +20,8 @@ import {fileURLToPath} from 'node:url';
import path from 'path';
import {bench, describe} from 'vitest';
import {parseJson} from '../dev/json.js';
-import {createFindKanjiOptions, createFindTermsOptions} from '../test/utilities/translator.js';
import {createTranslatorContext} from '../test/fixtures/translator-test.js';
+import {createFindKanjiOptions, createFindTermsOptions} from '../test/utilities/translator.js';
const dirname = path.dirname(fileURLToPath(import.meta.url));
const dictionaryName = 'Test Dictionary 2';
@@ -33,10 +33,9 @@ describe('Translator', () => {
const {optionsPresets, tests} = parseJson(readFileSync(testInputsFilePath, {encoding: 'utf8'}));
const findKanjiTests = tests.filter((data) => data.options === 'kanji');
- const findTermTests = tests.filter((data) => data.options === 'default');
- const findTermWithTextTransformationsTests = tests.filter((data) => data.options !== 'kanji' && data.options !== 'default');
+ const findTermTests = tests.filter((data) => data.options !== 'kanji');
- bench(`Translator.prototype.findTerms - no text transformations (n=${findTermTests.length})`, async () => {
+ bench(`Translator.prototype.findTerms - (n=${findTermTests.length})`, async () => {
for (const data of /** @type {import('test/translator').TestInputFindTerm[]} */ (findTermTests)) {
const {mode, text} = data;
const options = createFindTermsOptions(dictionaryName, optionsPresets, data.options);
@@ -44,14 +43,6 @@ describe('Translator', () => {
}
});
- bench(`Translator.prototype.findTerms - text transformations (n=${findTermWithTextTransformationsTests.length})`, async () => {
- for (const data of /** @type {import('test/translator').TestInputFindTerm[]} */ (findTermWithTextTransformationsTests)) {
- const {mode, text} = data;
- const options = createFindTermsOptions(dictionaryName, optionsPresets, data.options);
- await translator.findTerms(mode, text, options);
- }
- });
-
bench(`Translator.prototype.findKanji - (n=${findKanjiTests.length})`, async () => {
for (const data of /** @type {import('test/translator').TestInputFindKanji[]} */ (findKanjiTests)) {
const {text} = data;