Sometimes as a software engineer we just want to write tests without hassle. EXP is a general purpose JS test framework that is lightweight and super easy to use, from the creators of Tesults, the test reporting app. While it’s probably not appropriate for front-end heavy testing that requires driving a browser or mobile app, it is perfect for back-end or general testing for services.
Create a JS file and name it whatever e.g. test.js and paste this in:
module.exports = { cases: [] }
That’s a valid test file with no tests. In the cases array, just tests, for example:
module.exports = {
cases: [
{
name: "Test 1",
test: function () {'{'}...{'}'}
},
{
name: "Test 2",
test: function () {'{'}...{'}'}
}
]
}
The function in the test property carries out the testing. If it returns nothing (undefined) the test is considered a pass otherwise it’s a failure.
Run the tests with a single command.
Learn more at https://www.tesults.com/docs/exp