summaryrefslogtreecommitdiff
path: root/test/anki-template-renderer.test.js
diff options
context:
space:
mode:
authorJames Maa <jmaa@berkeley.edu>2024-05-31 08:06:52 -0700
committerGitHub <noreply@github.com>2024-05-31 15:06:52 +0000
commit76ca08bd59f0e8bfa1bb20ac813f48e7ab241265 (patch)
treebdba43d9ba704885383c7f308c6fe3f574c647c5 /test/anki-template-renderer.test.js
parentb3f54747eb2694bdc90bce72e5532e99d374ef08 (diff)
Allow trailing commas in ESLint (#1013)
* Update comma-dangle rule * Fix dangling commas
Diffstat (limited to 'test/anki-template-renderer.test.js')
-rw-r--r--test/anki-template-renderer.test.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/anki-template-renderer.test.js b/test/anki-template-renderer.test.js
index d8d2a3b5..bf18dd0d 100644
--- a/test/anki-template-renderer.test.js
+++ b/test/anki-template-renderer.test.js
@@ -34,7 +34,7 @@ describe('AnkiTemplateRenderer', () => {
tags: [],
stats: {},
definitions: [],
- frequencies: []
+ frequencies: [],
},
resultOutputMode: 'split',
mode: 'test',
@@ -47,43 +47,43 @@ describe('AnkiTemplateRenderer', () => {
fullQuery: 'query.full',
sentence: {
text: 'sentence.query.full',
- offset: 9
- }
+ offset: 9,
+ },
},
- media: void 0
- }
+ media: void 0,
+ },
};
const testCases = [
{
name: 'regexMatch 1',
template: '{{#regexMatch "test" "gu"}}this is a test of regexMatch{{/regexMatch}}',
- result: 'test'
+ result: 'test',
},
{
name: 'regexMatch 2',
template: '{{regexMatch "test" "gu" "this is a test of regexMatch"}}',
- result: 'test'
+ result: 'test',
},
{
name: 'regexMatch 3',
template: '{{#if (regexMatch "test" "gu" "this is a test of regexMatch")}}true{{else}}false{{/if}}',
- result: 'true'
+ result: 'true',
},
{
name: 'regexReplace 1',
template: '{{#regexReplace "test" "TEST" "gu"}}this is a test of regexReplace{{/regexReplace}}',
- result: 'this is a TEST of regexReplace'
+ result: 'this is a TEST of regexReplace',
},
{
name: 'regexReplace 2',
template: '{{regexReplace "test" "TEST" "gu" "this is a test of regexReplace"}}',
- result: 'this is a TEST of regexReplace'
+ result: 'this is a TEST of regexReplace',
},
{
name: 'regexReplace 3',
template: '{{#if (regexReplace "test" "" "gu" "test")}}true{{else}}false{{/if}}',
- result: 'false'
- }
+ result: 'false',
+ },
];
describe.each(testCases)('$name', ({template, result: expectedResult}) => {
test('Test', ({expect, ankiTemplateRenderer}) => {