From ac4d26a964977ef58957c1547f3e8296f632e893 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Mon, 13 Oct 2025 10:57:46 -0700 Subject: [PATCH] Refactor: Use shared prompt from README config --- tests/1_dijkstra/test.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/1_dijkstra/test.js b/tests/1_dijkstra/test.js index ca15e1d..59b3ae2 100644 --- a/tests/1_dijkstra/test.js +++ b/tests/1_dijkstra/test.js @@ -1,14 +1,10 @@ export default { functionName: 'findShortestPath', - prompt: ` -// Your goal is to write a production-ready and maintainable JavaScript function. Apply code-golfing practices without sacrificing readability by putting everything on one line. Do not include any comments in your code. -// -// Write an async JavaScript function 'findShortestPath' that finds the shortest path in a weighted, undirected graph using Dijkstra's algorithm. + prompt: `// Write an async JavaScript function 'findShortestPath' that finds the shortest path in a weighted, undirected graph using Dijkstra's algorithm. // - The function must accept a graph, a start node, and an end node. // - You MUST use a dynamic import() to load the 'js-priority-queue' library from a CDN (e.g., jsdelivr) for the priority queue. // - The function should return the total weight of the shortest path, or Infinity if no path exists. -// - Graph format: { 'A': { 'B': 1, 'C': 4 }, 'B': { ... }, ... } -`, +// - Graph format: { 'A': { 'B': 1, 'C': 4 }, 'B': { ... }, ... }`, runTest: async (findShortestPath) => { const assert = { strictEqual: (a, e, m) => { if (a !== e) throw new Error(m || `FAIL: ${a} !== ${e}`) },