Skip to content

Commit 26c78ad

Browse files
committed
test: - Make Variation Selectors visible in snapshot test
1 parent e2ef848 commit 26c78ad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/TaskSerializer/DefaultTaskSerializer.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
import { TaskBuilder } from '../TestingTools/TaskBuilder';
1414
import { OnCompletion } from '../../src/Task/OnCompletion';
1515
import { Priority } from '../../src/Task/Priority';
16+
import { escapeInvisibleCharacters } from '../../src/lib/StringHelpers';
1617

1718
jest.mock('obsidian');
1819
window.moment = moment;
@@ -57,8 +58,8 @@ describe('validate emoji regular expressions', () => {
5758
throw new Error(`Unexpected value for ${key}: Not a regular expression.`);
5859
}
5960
});
60-
// Concatenate all entries into a single string
61-
return '\n' + regexDetails.join('\n') + '\n';
61+
// Concatenate all entries into a single string, with any Variation Selectors made visible
62+
return escapeInvisibleCharacters('\n' + regexDetails.join('\n') + '\n');
6263
}
6364

6465
it('regular expressions should have expected source', () => {
@@ -73,7 +74,7 @@ describe('validate emoji regular expressions', () => {
7374
cancelledDateRegex: /❌ *(\\d{4}-\\d{2}-\\d{2})$/u
7475
recurrenceRegex: /🔁 *([a-zA-Z0-9, !]+)$/u
7576
onCompletionRegex: /🏁 *([a-zA-Z]+)$/u
76-
dependsOnRegex: /⛔? *([a-zA-Z0-9-_]+( *, *[a-zA-Z0-9-_]+ *)*)$/u
77+
dependsOnRegex: /⛔\\ufe0f? *([a-zA-Z0-9-_]+( *, *[a-zA-Z0-9-_]+ *)*)$/u
7778
idRegex: /🆔 *([a-zA-Z0-9-_]+)$/u
7879
"
7980
`);

0 commit comments

Comments
 (0)