mirror of https://github.com/n2geoff/testit.git
linting
This commit is contained in:
parent
98c7523881
commit
8d880193a5
|
@ -2,12 +2,12 @@ import test from "../src/testit.js";
|
|||
|
||||
export default test.it({
|
||||
"'like' should do truthy evaluation via ==": function () {
|
||||
test.assert(1 == '1');
|
||||
test.assert(1 == "1");
|
||||
test.assert(1);
|
||||
},
|
||||
"'equal' should do === evaluation exist": function () {
|
||||
test.assert(1 === 1);
|
||||
test.assert('hello' === 'hello');
|
||||
test.assert("hello" === "hello");
|
||||
},
|
||||
"you should be able to 'pass' a test": function () {
|
||||
test.assert(1);
|
||||
|
@ -16,20 +16,21 @@ export default test.it({
|
|||
try {
|
||||
test.assert(0);
|
||||
} catch (e) {
|
||||
// correct
|
||||
}
|
||||
},
|
||||
"you should be able to test if something 'exists'": function () {
|
||||
test.assert({});
|
||||
test.assert(typeof ({}) === 'object');
|
||||
test.assert(typeof ({}) === "object");
|
||||
},
|
||||
"should be able to check types": function () {
|
||||
|
||||
test.assert(Array.isArray([]));
|
||||
test.assert(typeof (123) === 'number');
|
||||
test.assert(typeof (123) === "number");
|
||||
|
||||
test.assert(typeof ({}) === 'object');
|
||||
test.assert(typeof (true) === 'boolean');
|
||||
test.assert(typeof (false) === 'boolean');
|
||||
test.assert(typeof (undefined) === 'undefined');
|
||||
test.assert(typeof ({}) === "object");
|
||||
test.assert(typeof (true) === "boolean");
|
||||
test.assert(typeof (false) === "boolean");
|
||||
test.assert(typeof (undefined) === "undefined");
|
||||
}
|
||||
});
|
||||
|
|
|
@ -10,6 +10,6 @@ spec.run(false, function (r) {
|
|||
r.pass.forEach((p) => errors.push(`<br>${p}`));
|
||||
r.fail.forEach((f) => errors.push(`<br><b>${f}</b>`));
|
||||
|
||||
document.querySelector('#errors').innerHTML = errors;
|
||||
document.querySelector('#summary').innerHTML = `| tests: ${r.pass.length + r.fail.length} | pass: ${r.pass.length} | fail: ${r.fail.length} |`;
|
||||
document.querySelector("#errors").innerHTML = errors;
|
||||
document.querySelector("#summary").innerHTML = `| tests: ${r.pass.length + r.fail.length} | pass: ${r.pass.length} | fail: ${r.fail.length} |`;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue