diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-07-03 11:30:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-03 11:30:48 -0400 |
commit | f7d177e6d0f970ba6600fbf3911fccc093553eef (patch) | |
tree | d83865cb66308f98b57bea7d9e1ca172c257e049 /test | |
parent | d7c934cae8c4f0747a0298b7e237ebab4efd48e5 (diff) |
Refactor createNote (#1789)
* Update createNote to return a wrapper object
* Update how createNote creates errors
Diffstat (limited to 'test')
-rw-r--r-- | test/test-anki-note-builder.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test/test-anki-note-builder.js b/test/test-anki-note-builder.js index 2517e521..97489aa8 100644 --- a/test/test-anki-note-builder.js +++ b/test/test-anki-note-builder.js @@ -219,8 +219,7 @@ async function getRenderResults(dictionaryEntries, type, mode, template, AnkiNot query: 'query', fullQuery: 'fullQuery' }; - const errors = []; - const noteFields = (await ankiNoteBuilder.createNote({ + const {note: {fields: noteFields}, errors} = await ankiNoteBuilder.createNote({ dictionaryEntry, mode: null, context, @@ -234,11 +233,10 @@ async function getRenderResults(dictionaryEntries, type, mode, template, AnkiNot duplicateScope: 'collection', resultOutputMode: mode, glossaryLayoutMode: 'default', - compactTags: false, - errors - })).fields; + compactTags: false + }); if (!write) { - assert.deepStrictEqual(errors, []); + assert.strictEqual(errors.length, 0); } results.push(noteFields); } |