Refactor: Convert test definition to ES Module

This commit is contained in:
2025-10-13 06:05:31 -07:00
parent fc7b5e22e4
commit 7efae39296

View File

@@ -1,4 +1,4 @@
module.exports = { export default {
prompt: ` prompt: `
// Write an async JavaScript function 'calculateDeterminant' that calculates the determinant of a square matrix. // Write an async JavaScript function 'calculateDeterminant' that calculates the determinant of a square matrix.
// - The function must accept an n x n matrix, represented as an array of arrays. // - The function must accept an n x n matrix, represented as an array of arrays.
@@ -7,7 +7,7 @@ module.exports = {
// - The function should return the determinant value. // - The function should return the determinant value.
`, `,
harness: ` harness: `
const assert = require('assert'); import assert from 'assert';
async function runTest() { async function runTest() {
const matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; const matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
try { try {