From 2282d308b4df6b9a5d86090bd767fbf87b2321d9 Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Wed, 21 Aug 2024 08:10:23 -0500 Subject: [PATCH] Correct script typo --- docs/_static/test-c.html | 74 +++++++++++++++++++-------------------- docs/_static/test-cp.html | 74 +++++++++++++++++++-------------------- 2 files changed, 72 insertions(+), 76 deletions(-) diff --git a/docs/_static/test-c.html b/docs/_static/test-c.html index f6d63bc9..3604bc59 100644 --- a/docs/_static/test-c.html +++ b/docs/_static/test-c.html @@ -14,48 +14,46 @@ import * as wasm from './dist/c-lib.js'; mocha.setup('bdd'); window.onload = function() { - init().then(() => { - for (let p = 1; p < 10000; p++) { - const formattedQuestion = `${p}`.padStart(4, '0'); - const func = wasm[`_p${formattedQuestion}`]; - if (func === undefined) continue; - const expected = wasm._get_answer(p); - describe(`run test ${p}`, function() { - this.timeout(Infinity); - it(`should return ${expected}`, async () => { - const answer = func(); - console.log(p, answer, expected); - if (answer !== expected) { - throw new Error(); - } - }); + for (let p = 1; p < 10000; p++) { + const formattedQuestion = `${p}`.padStart(4, '0'); + const func = wasm[`_p${formattedQuestion}`]; + if (func === undefined) continue; + const expected = wasm._get_answer(p); + describe(`run test ${p}`, function() { + this.timeout(Infinity); + it(`should return ${expected}`, async () => { + const answer = func(); + console.log(p, answer, expected); + if (answer !== expected) { + throw new Error(); + } }); - } - const runner = mocha.run(); - let failedTests = []; - - runner.on('end', function() { - window.mochaResults = runner.stats; - window.mochaResults.reports = failedTests; }); + } + const runner = mocha.run(); + let failedTests = []; - runner.on('fail', function(test, err){ - const flattenTitles = function(test){ - let titles = []; - while (test.parent.title){ - titles.push(test.parent.title); - test = test.parent; - } - return titles.reverse(); - }; + runner.on('end', function() { + window.mochaResults = runner.stats; + window.mochaResults.reports = failedTests; + }); - failedTests.push({ - name: test.title, - result: false, - message: err.message, - stack: err.stack, - titles: flattenTitles(test) - }); + runner.on('fail', function(test, err){ + const flattenTitles = function(test){ + let titles = []; + while (test.parent.title){ + titles.push(test.parent.title); + test = test.parent; + } + return titles.reverse(); + }; + + failedTests.push({ + name: test.title, + result: false, + message: err.message, + stack: err.stack, + titles: flattenTitles(test) }); }); }; diff --git a/docs/_static/test-cp.html b/docs/_static/test-cp.html index ce8fe5f4..502cfa6f 100644 --- a/docs/_static/test-cp.html +++ b/docs/_static/test-cp.html @@ -14,48 +14,46 @@ import * as wasm from './dist/cp-lib.js'; mocha.setup('bdd'); window.onload = function() { - init().then(() => { - for (let p = 1; p < 10000; p++) { - const formattedQuestion = `${p}`.padStart(4, '0'); - const func = wasm[`_p${formattedQuestion}`]; - if (func === undefined) continue; - const expected = wasm._get_answer(p); - describe(`run test ${p}`, function() { - this.timeout(Infinity); - it(`should return ${expected}`, async () => { - const answer = func(); - console.log(p, answer, expected); - if (answer !== expected) { - throw new Error(); - } - }); + for (let p = 1; p < 10000; p++) { + const formattedQuestion = `${p}`.padStart(4, '0'); + const func = wasm[`_p${formattedQuestion}`]; + if (func === undefined) continue; + const expected = wasm._get_answer(p); + describe(`run test ${p}`, function() { + this.timeout(Infinity); + it(`should return ${expected}`, async () => { + const answer = func(); + console.log(p, answer, expected); + if (answer !== expected) { + throw new Error(); + } }); - } - const runner = mocha.run(); - let failedTests = []; - - runner.on('end', function() { - window.mochaResults = runner.stats; - window.mochaResults.reports = failedTests; }); + } + const runner = mocha.run(); + let failedTests = []; - runner.on('fail', function(test, err){ - const flattenTitles = function(test){ - let titles = []; - while (test.parent.title){ - titles.push(test.parent.title); - test = test.parent; - } - return titles.reverse(); - }; + runner.on('end', function() { + window.mochaResults = runner.stats; + window.mochaResults.reports = failedTests; + }); - failedTests.push({ - name: test.title, - result: false, - message: err.message, - stack: err.stack, - titles: flattenTitles(test) - }); + runner.on('fail', function(test, err){ + const flattenTitles = function(test){ + let titles = []; + while (test.parent.title){ + titles.push(test.parent.title); + test = test.parent; + } + return titles.reverse(); + }; + + failedTests.push({ + name: test.title, + result: false, + message: err.message, + stack: err.stack, + titles: flattenTitles(test) }); }); };