journal/tool/tests.jq
2024-11-09 00:57:22 +00:00

34 lines
790 B
Plaintext

include "dropins";
import "lib/testLib" as testLib;
import "lib/typeLib" as typeLib;
import "lib/journalLib" as journalLib;
import "journalUtils" as journalUtils;
import "testdata/tests_export" as $exportDataArray;
def journalUtilsTests:
testLib::expectPassed(testLib::runTest(
"invalid input to experienceByTitle";
(
null | journalLib::experienceByTitle("Test")
);
. == "experienceByTitle takes a array of experiences as input";
true
)) |
testLib::expectPassed(testLib::runTest(
"experience not found";
(
$exportDataArray[0].experiences | journalLib::experienceByTitle("Test")
);
. == null;
false
));
def testsMain:
testLib::testTests |
typeLib::typeLibTests |
journalUtilsTests |
"Tests Passed\n" | halt_error(0);