aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/data/anki-note-builder-test-results.json263
-rw-r--r--test/test-anki-note-builder.js2
2 files changed, 2 insertions, 263 deletions
diff --git a/test/data/anki-note-builder-test-results.json b/test/data/anki-note-builder-test-results.json
index 9b7c7f65..cf80d6a6 100644
--- a/test/data/anki-note-builder-test-results.json
+++ b/test/data/anki-note-builder-test-results.json
@@ -998,268 +998,7 @@
},
{
"name": "Search using different modes",
- "results": [
- {
- "audio": "",
- "clipboard-image": "",
- "clipboard-text": "",
- "cloze-body": "打ち込む",
- "cloze-prefix": "cloze-prefix",
- "cloze-suffix": "cloze-suffix",
- "conjugation": "",
- "dictionary": "Test Dictionary 2",
- "document-title": "title",
- "expression": "打ち込む",
- "frequencies": "",
- "furigana": "<ruby>打<rt>う</rt></ruby>ち<ruby>込<rt>こ</rt></ruby>む",
- "furigana-plain": "打[う]ち 込[こ]む",
- "glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition13</li><li>definition14</li></ul></div>",
- "glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition13</li><li>definition14</li></ul></div>",
- "glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition13</li><li>definition14</li></ul></div>",
- "pitch-accents": "No pitch accent data",
- "pitch-accent-graphs": "No pitch accent data",
- "pitch-accent-positions": "No pitch accent data",
- "reading": "うちこむ",
- "screenshot": "<img src=\"\" />",
- "sentence": "cloze-prefix打ち込むcloze-suffix",
- "tags": "tag1, tag2",
- "url": "<a href=\"url:\">url:</a>"
- },
- {
- "audio": "",
- "clipboard-image": "",
- "clipboard-text": "",
- "cloze-body": "打ち込む",
- "cloze-prefix": "cloze-prefix",
- "cloze-suffix": "cloze-suffix",
- "conjugation": "",
- "dictionary": "Test Dictionary 2",
- "document-title": "title",
- "expression": "打ち込む",
- "frequencies": "",
- "furigana": "<ruby>打<rt>ぶ</rt></ruby>ち<ruby>込<rt>こ</rt></ruby>む",
- "furigana-plain": "打[ぶ]ち 込[こ]む",
- "glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition17</li><li>definition18</li></ul></div>",
- "glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition17</li><li>definition18</li></ul></div>",
- "glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition17</li><li>definition18</li></ul></div>",
- "pitch-accents": "No pitch accent data",
- "pitch-accent-graphs": "No pitch accent data",
- "pitch-accent-positions": "No pitch accent data",
- "reading": "ぶちこむ",
- "screenshot": "<img src=\"\" />",
- "sentence": "cloze-prefix打ち込むcloze-suffix",
- "tags": "tag1, tag2",
- "url": "<a href=\"url:\">url:</a>"
- },
- {
- "audio": "",
- "clipboard-image": "",
- "clipboard-text": "",
- "cloze-body": "打ち込む",
- "cloze-prefix": "cloze-prefix",
- "cloze-suffix": "cloze-suffix",
- "conjugation": "",
- "dictionary": "Test Dictionary 2",
- "document-title": "title",
- "expression": "打ち込む",
- "frequencies": "",
- "furigana": "<ruby>打<rt>う</rt></ruby>ち<ruby>込<rt>こ</rt></ruby>む",
- "furigana-plain": "打[う]ち 込[こ]む",
- "glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition15</li><li>definition16</li></ul></div>",
- "glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition15</li><li>definition16</li></ul></div>",
- "glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition15</li><li>definition16</li></ul></div>",
- "pitch-accents": "No pitch accent data",
- "pitch-accent-graphs": "No pitch accent data",
- "pitch-accent-positions": "No pitch accent data",
- "reading": "うちこむ",
- "screenshot": "<img src=\"\" />",
- "sentence": "cloze-prefix打ち込むcloze-suffix",
- "tags": "tag1, tag2",
- "url": "<a href=\"url:\">url:</a>"
- },
- {
- "audio": "",
- "clipboard-image": "",
- "clipboard-text": "",
- "cloze-body": "打ち込む",
- "cloze-prefix": "cloze-prefix",
- "cloze-suffix": "cloze-suffix",
- "conjugation": "",
- "dictionary": "Test Dictionary 2",
- "document-title": "title",
- "expression": "打ち込む",
- "frequencies": "",
- "furigana": "<ruby>打<rt>ぶ</rt></ruby>ち<ruby>込<rt>こ</rt></ruby>む",
- "furigana-plain": "打[ぶ]ち 込[こ]む",
- "glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition19</li><li>definition20</li></ul></div>",
- "glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition19</li><li>definition20</li></ul></div>",
- "glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition19</li><li>definition20</li></ul></div>",
- "pitch-accents": "No pitch accent data",
- "pitch-accent-graphs": "No pitch accent data",
- "pitch-accent-positions": "No pitch accent data",
- "reading": "ぶちこむ",
- "screenshot": "<img src=\"\" />",
- "sentence": "cloze-prefix打ち込むcloze-suffix",
- "tags": "tag1, tag2",
- "url": "<a href=\"url:\">url:</a>"
- },
- {
- "audio": "",
- "clipboard-image": "",
- "clipboard-text": "",
- "cloze-body": "打ち",
- "cloze-prefix": "cloze-prefix",
- "cloze-suffix": "cloze-suffix",
- "conjugation": "masu stem",
- "dictionary": "Test Dictionary 2",
- "document-title": "title",
- "expression": "打つ",
- "frequencies": "",
- "furigana": "<ruby>打<rt>う</rt></ruby>つ",
- "furigana-plain": "打[う]つ",
- "glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition5</li><li>definition6</li></ul></div>",
- "glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition5</li><li>definition6</li></ul></div>",
- "glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition5</li><li>definition6</li></ul></div>",
- "pitch-accents": "No pitch accent data",
- "pitch-accent-graphs": "No pitch accent data",
- "pitch-accent-positions": "No pitch accent data",
- "reading": "うつ",
- "screenshot": "<img src=\"\" />",
- "sentence": "cloze-prefix打ちcloze-suffix",
- "tags": "tag1, tag2",
- "url": "<a href=\"url:\">url:</a>"
- },
- {
- "audio": "",
- "clipboard-image": "",
- "clipboard-text": "",
- "cloze-body": "打ち",
- "cloze-prefix": "cloze-prefix",
- "cloze-suffix": "cloze-suffix",
- "conjugation": "masu stem",
- "dictionary": "Test Dictionary 2",
- "document-title": "title",
- "expression": "打つ",
- "frequencies": "",
- "furigana": "<ruby>打<rt>ぶ</rt></ruby>つ",
- "furigana-plain": "打[ぶ]つ",
- "glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition9</li><li>definition10</li></ul></div>",
- "glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition9</li><li>definition10</li></ul></div>",
- "glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition9</li><li>definition10</li></ul></div>",
- "pitch-accents": "No pitch accent data",
- "pitch-accent-graphs": "No pitch accent data",
- "pitch-accent-positions": "No pitch accent data",
- "reading": "ぶつ",
- "screenshot": "<img src=\"\" />",
- "sentence": "cloze-prefix打ちcloze-suffix",
- "tags": "tag1, tag2",
- "url": "<a href=\"url:\">url:</a>"
- },
- {
- "audio": "",
- "clipboard-image": "",
- "clipboard-text": "",
- "cloze-body": "打ち",
- "cloze-prefix": "cloze-prefix",
- "cloze-suffix": "cloze-suffix",
- "conjugation": "masu stem",
- "dictionary": "Test Dictionary 2",
- "document-title": "title",
- "expression": "打つ",
- "frequencies": "",
- "furigana": "<ruby>打<rt>う</rt></ruby>つ",
- "furigana-plain": "打[う]つ",
- "glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition7</li><li>definition8</li></ul></div>",
- "glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition7</li><li>definition8</li></ul></div>",
- "glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition7</li><li>definition8</li></ul></div>",
- "pitch-accents": "No pitch accent data",
- "pitch-accent-graphs": "No pitch accent data",
- "pitch-accent-positions": "No pitch accent data",
- "reading": "うつ",
- "screenshot": "<img src=\"\" />",
- "sentence": "cloze-prefix打ちcloze-suffix",
- "tags": "tag1, tag2",
- "url": "<a href=\"url:\">url:</a>"
- },
- {
- "audio": "",
- "clipboard-image": "",
- "clipboard-text": "",
- "cloze-body": "打ち",
- "cloze-prefix": "cloze-prefix",
- "cloze-suffix": "cloze-suffix",
- "conjugation": "masu stem",
- "dictionary": "Test Dictionary 2",
- "document-title": "title",
- "expression": "打つ",
- "frequencies": "",
- "furigana": "<ruby>打<rt>ぶ</rt></ruby>つ",
- "furigana-plain": "打[ぶ]つ",
- "glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition11</li><li>definition12</li></ul></div>",
- "glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition11</li><li>definition12</li></ul></div>",
- "glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition11</li><li>definition12</li></ul></div>",
- "pitch-accents": "No pitch accent data",
- "pitch-accent-graphs": "No pitch accent data",
- "pitch-accent-positions": "No pitch accent data",
- "reading": "ぶつ",
- "screenshot": "<img src=\"\" />",
- "sentence": "cloze-prefix打ちcloze-suffix",
- "tags": "tag1, tag2",
- "url": "<a href=\"url:\">url:</a>"
- },
- {
- "audio": "",
- "clipboard-image": "",
- "clipboard-text": "",
- "cloze-body": "打",
- "cloze-prefix": "cloze-prefix",
- "cloze-suffix": "cloze-suffix",
- "conjugation": "",
- "dictionary": "Test Dictionary 2",
- "document-title": "title",
- "expression": "打",
- "frequencies": "",
- "furigana": "<ruby>打<rt>だ</rt></ruby>",
- "furigana-plain": "打[だ]",
- "glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition1</li><li>definition2</li></ul></div>",
- "glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition1</li><li>definition2</li></ul></div>",
- "glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition1</li><li>definition2</li></ul></div>",
- "pitch-accents": "No pitch accent data",
- "pitch-accent-graphs": "No pitch accent data",
- "pitch-accent-positions": "No pitch accent data",
- "reading": "だ",
- "screenshot": "<img src=\"\" />",
- "sentence": "cloze-prefix打cloze-suffix",
- "tags": "tag1, tag2",
- "url": "<a href=\"url:\">url:</a>"
- },
- {
- "audio": "",
- "clipboard-image": "",
- "clipboard-text": "",
- "cloze-body": "打",
- "cloze-prefix": "cloze-prefix",
- "cloze-suffix": "cloze-suffix",
- "conjugation": "",
- "dictionary": "Test Dictionary 2",
- "document-title": "title",
- "expression": "打",
- "frequencies": "",
- "furigana": "<ruby>打<rt>ダース</rt></ruby>",
- "furigana-plain": "打[ダース]",
- "glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition3</li><li>definition4</li></ul></div>",
- "glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition3</li><li>definition4</li></ul></div>",
- "glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition3</li><li>definition4</li></ul></div>",
- "pitch-accents": "No pitch accent data",
- "pitch-accent-graphs": "No pitch accent data",
- "pitch-accent-positions": "No pitch accent data",
- "reading": "ダース",
- "screenshot": "<img src=\"\" />",
- "sentence": "cloze-prefix打cloze-suffix",
- "tags": "tag1, tag2",
- "url": "<a href=\"url:\">url:</a>"
- }
- ]
+ "results": null
},
{
"name": "Search using different modes",
diff --git a/test/test-anki-note-builder.js b/test/test-anki-note-builder.js
index f28bebef..deee5b6c 100644
--- a/test/test-anki-note-builder.js
+++ b/test/test-anki-note-builder.js
@@ -194,7 +194,7 @@ async function main() {
const {name, mode, text} = test;
const options = vm.buildOptions(optionsPresets, test.options);
const [definitions] = clone(await vm.translator.findTerms(mode, text, options));
- const results = clone(await getRenderResults(definitions, 'terms', mode, templates, AnkiNoteBuilder, write));
+ const results = mode !== 'simple' ? clone(await getRenderResults(definitions, 'terms', mode, templates, AnkiNoteBuilder, write)) : null;
actualResults1.push({name, results});
if (!write) {
assert.deepStrictEqual(results, expected1.results);