Skip to content

Instantly share code, notes, and snippets.

View Cooperbuilt's full-sized avatar

Evan Cooper Cooperbuilt

View GitHub Profile
@Cooperbuilt
Cooperbuilt / simple_test_framework.js
Last active December 29, 2020 13:40
A simple JS testing framework
function expect(initialValue) {
return {
toStrictlyEqual(expected) {
return Object.is(initialValue, expected)
},
toLooselyEqual(expected) {
return initialValue == expected || JSON.stringify(initialValue) === JSON.stringify(expected);
}
}
}