From 2beb6c8dc64aaa81c12347d28467ccd5b742bd93 Mon Sep 17 00:00:00 2001 From: MeaslyDay <72430306+MeaslyDay@users.noreply.github.com> Date: Wed, 10 Dec 2025 00:20:13 -0800 Subject: [PATCH] fix(tools): update error message for hints without tests (#64354) Co-authored-by: Jessica Wilkins <67210629+jdwilkin4@users.noreply.github.com> Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com> --- tools/challenge-parser/parser/plugins/add-tests.js | 4 +++- tools/challenge-parser/parser/plugins/add-tests.test.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/challenge-parser/parser/plugins/add-tests.js b/tools/challenge-parser/parser/plugins/add-tests.js index 2776e2b0189..29604909c1f 100644 --- a/tools/challenge-parser/parser/plugins/add-tests.js +++ b/tools/challenge-parser/parser/plugins/add-tests.js @@ -8,7 +8,9 @@ function plugin() { function transformer(tree, file) { const hintNodes = getSection(tree, '--hints--'); if (hintNodes.length % 2 !== 0) - throw Error('Tests must be in (text, ```testString```) order'); + throw Error( + 'Hints must be in pairs: each hint text followed by a test code block' + ); const tests = chunk(hintNodes, 2).map(getTest); file.data.tests = tests; diff --git a/tools/challenge-parser/parser/plugins/add-tests.test.js b/tools/challenge-parser/parser/plugins/add-tests.test.js index 2f7c614e3b5..e893fcc7f87 100644 --- a/tools/challenge-parser/parser/plugins/add-tests.test.js +++ b/tools/challenge-parser/parser/plugins/add-tests.test.js @@ -42,7 +42,7 @@ describe('add-tests plugin', () => { it('should throw if a test pair is out of order', () => { // TODO: update the markdown so it makes this error expect(() => plugin(brokenHintsAST, file)).toThrow( - 'Tests must be in (text, ```testString```) order' + 'Hints must be in pairs: each hint text followed by a test code block' ); });