<!DOCTYPE html>
<html lang="en"><head>
<title>codemelted.js Module | Test Results</title>
<meta charset="UTF-8">
<meta name="description" content="An implementation of the mocha test environment for validating the codemelted.js module in a web environment. It will also reflect the code coverage of the deno environment.">
<meta name="keywords" content="mocha, chai, codemelted_developer, codemelted, js_module">
<meta name="author" content="Mark Shaffer">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="https://codemelted.com/favicon.png">
<style>
@import url("https://unpkg.com/mocha@11.7.1/mocha.css");
body {
margin-top: 175px;
}
.codemelted-title {
background-color: #36454F;
position: fixed;
top: 40px;
left: 0;
right: 0;
}
.codemelted-title img {
height: 35px;
padding: 5px;
}
.codemelted-title div {
display: grid;
grid-template-columns: auto auto;
}
.codemelted-title button {
font-size: medium;
background-color: black;
color: white;
width: 150px;
cursor: pointer;
margin: 5px;
}
.codemelted-title button:hover {
background-color: darkslategrey;
color: yellow;
}
#coverage {
position: fixed;
display: none;
background-color: wheat;
left: 0px;
top: 154px;
height: calc(99.5vh - 154px);
width: 100%;
}
</style>
<script>
function btnMochaChaiClicked() {
document.getElementById("mocha").style.display = "inherit";
document.getElementById("coverage").style.display = "none";
}
function btnDenoTestsClicked() {
document.getElementById("mocha").style.display = "none";
document.getElementById("coverage").style.display = "inherit";
}
</script>
</head><body>
<h2 class="codemelted-title">
<a href="./index.html"><img src="https://codemelted.com/assets/favicon/apple-touch-icon.png" /></a>
codemelted.js Module Test Results
<div>
<center><button onclick="btnMochaChaiClicked();">☕ Mocha / Chai</button></center>
<center><button onclick="btnDenoTestsClicked();">🦖 Deno Test</button></center>
</div>
</h2>
<div id="mocha"></div>
<iframe id="coverage" frameborder="0" src="coverage/index.html" ></iframe>
<script type="module">
import {assert} from "https://unpkg.com/chai@5.2.0/chai.js";
import "https://unpkg.com/mocha@11.7.1/mocha.js";
import {
console_alert,
console_confirm,
console_choose,
console_password,
console_prompt,
console_writeln,
runtime_cpu_arch,
runtime_home_path,
runtime_newline,
runtime_os_name,
runtime_path_separator,
runtime_temp_path,
runtime_user,
ui_dialog
} from "./codemelted.js";
mocha.setup('bdd');
describe("Functions Not Browser Supported Validation", () => {
it("console_xxx() Throws API_UNSUPPORTED_PLATFORM", () => {
assert.throws(() => console_alert(), SyntaxError);
assert.throws(() => console_confirm(), SyntaxError);
assert.throws(() => console_choose({}), SyntaxError);
assert.throws(() => console_password(), SyntaxError);
assert.throws(() => console_prompt(), SyntaxError);
assert.throws(() => console_writeln(), SyntaxError);
});
it("runtime_xxx() Throws API_UNSUPPORTED_PLATFORM", () => {
assert.throws(() => runtime_cpu_arch(), SyntaxError);
assert.throws(() => runtime_home_path(), SyntaxError);
assert.throws(() => runtime_newline(), SyntaxError);
assert.throws(() => runtime_os_name(), SyntaxError);
assert.throws(() => runtime_path_separator(), SyntaxError);
assert.throws(() => runtime_temp_path(), SyntaxError);
assert.throws(() => runtime_user(), SyntaxError);
});
});
describe("UI Use Case Validation", () => {
it("ui_dialog({request: 'init'}) Demo", () => {
assert.doesNotThrow(() => ui_dialog({request: "init"}), Error, 'This function should not throw an error');
});
});
mocha.checkLeaks();
mocha.run();
</script>
</body></html>