Refactor: Convert test definition to ES Module

This commit is contained in:
2025-10-13 06:05:23 -07:00
parent acf1625272
commit 43619dd01c

View File

@@ -1,4 +1,4 @@
module.exports = { export default {
prompt: ` prompt: `
// Write an async JavaScript function 'findShortestPath' that finds the shortest path in a weighted, undirected graph using Dijkstra's algorithm. // 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. // - The function must accept a graph, a start node, and an end node.
@@ -7,7 +7,7 @@ module.exports = {
// - Graph format: { 'A': { 'B': 1, 'C': 4 }, 'B': { ... }, ... } // - Graph format: { 'A': { 'B': 1, 'C': 4 }, 'B': { ... }, ... }
`, `,
harness: ` harness: `
const assert = require('assert'); import assert from 'assert';
async function runTest() { async function runTest() {
const graph = { const graph = {
A: { B: 2, C: 5 }, A: { B: 2, C: 5 },