Skip to content

Commit debdba8

Browse files
committed
test(mf2): Make use of test tags to skip u:locale tests (unicode-org/message-format-wg#1050)
1 parent cbd9df2 commit debdba8

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

mf2/messageformat/src/spec.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import {
1919
visit
2020
} from './index.ts';
2121

22+
const skipTags = new Set(['u:locale']);
23+
2224
const tests = (tc: Test) => () => {
2325
const functions = { ...DraftFunctions, ...TestFunctions };
2426
switch (testType(tc)) {
@@ -121,7 +123,12 @@ const tests = (tc: Test) => () => {
121123
for (const scenario of testScenarios('test/messageformat-wg/test/tests')) {
122124
describe(scenario.scenario, () => {
123125
for (const tc of testCases(scenario)) {
124-
(tc.only ? describe.only : describe)(testName(tc), tests(tc));
126+
const describe_ = tc.only
127+
? describe.only
128+
: tc.tags?.some(tag => skipTags.has(tag))
129+
? describe.skip
130+
: describe;
131+
describe_(testName(tc), tests(tc));
125132
}
126133
});
127134
}

test/utils/mfwg-test-utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ type DefaultTestProperties = {
9393
| { name: string; type: 'datetime'; value: string }
9494
>;
9595

96+
/** List of features that the test relies on. */
97+
tags?: string[];
98+
9699
/** The expected result of formatting the message to a string. */
97100
exp?: string;
98101

0 commit comments

Comments
 (0)