// This was generated using github copilot, for the most part.
// my_test.js
// create a simple loging system for me, the developer
function log(message) {
console.log(message);
}
// create a simple test class that logs and accepts arguments to test as well
class Test {
constructor(name) {
this.name = name;
}
test(arg1, arg2) {
log(`Testing ${this.name}`);
// equality test
if (arg1 === arg2) {
log(`Test passed!`);
} else {
log(`Test failed!`);
}
}
}
Just a suggestion. When someone starts making pretty much anything “big”, ie. with a lot of code. Try to start testing asap. This is becoming more of the norm, and it prevents bugs in code that is also small! Good practice! Anyhow, any small code is eventually going to become large code too, it really doesn’t take much, Hope’s this helps and encourages someone!