Architecting the new framework
Now, we’ll get to the architectural part of our practical approach. So far, we know what we are building and who we are building it for. It is now time to determine the shape of our feature set and see how we can enable those features for our users. The most basic use case that we would like to cover is generating assertions for JavaScript code, as presented here:
// basic.js export function helloReader() { return "Hello reader!"; } // tests/basic.js import ct, { assert } from "componium-test"; import { helloReader } from "../basic.js"; ct({ basic: function () { assert.strictEqual(helloReader(), "Hello reader!", "output is correct"); }, });
The preceding code example tests the helloReader()
function and verifies that the correct string is returned. Starting from these basics, to take things further...