{"id":43876513,"url":"https://github.com/jmakeig/mltap","last_synced_at":"2026-02-06T14:44:54.194Z","repository":{"id":57299091,"uuid":"66623799","full_name":"jmakeig/mltap","owner":"jmakeig","description":"A JavaScript test harness for MarkLogic that (roughly) implements the Node.js tape API","archived":false,"fork":false,"pushed_at":"2017-04-15T08:36:57.000Z","size":153,"stargazers_count":0,"open_issues_count":17,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-11-01T07:18:56.300Z","etag":null,"topics":["marklogic","tap","test-harness","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmakeig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-26T06:48:53.000Z","updated_at":"2016-10-22T16:15:45.000Z","dependencies_parsed_at":"2022-08-26T18:13:14.825Z","dependency_job_id":null,"html_url":"https://github.com/jmakeig/mltap","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jmakeig/mltap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmakeig%2Fmltap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmakeig%2Fmltap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmakeig%2Fmltap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmakeig%2Fmltap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmakeig","download_url":"https://codeload.github.com/jmakeig/mltap/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmakeig%2Fmltap/sbom","scorecard":{"id":523880,"data":{"date":"2025-08-11","repo":{"name":"github.com/jmakeig/mltap","commit":"30942b90376ab41e8e2bd542d23e5e374bf16aa9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: downloadThenRun not pinned by hash: scripts/travis-install-ml.sh:26","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'develop'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T03:50:07.944Z","repository_id":57299091,"created_at":"2025-08-20T03:50:07.944Z","updated_at":"2025-08-20T03:50:07.944Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29165080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T14:37:12.680Z","status":"ssl_error","status_checked_at":"2026-02-06T14:36:22.973Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["marklogic","tap","test-harness","unit-testing"],"created_at":"2026-02-06T14:44:54.110Z","updated_at":"2026-02-06T14:44:54.180Z","avatar_url":"https://github.com/jmakeig.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## mltap [![Build Status](https://travis-ci.org/jmakeig/mltap.svg?branch=develop)](https://travis-ci.org/jmakeig/mltap)\n\n`mltap` is a **unit testing framework for [MarkLogic](https://developer.marklogic.com/)**. It includes a test harness for running tests in Server-Side JavaScript in MarkLogic, an assertion library, and a Node.js-based command-line wrapper. \n\n`mltap` (partially) implements the [tape](https://github.com/substack/tape) API, a popular Node.js test framework. This allows you to run the *same* tests in Node.js, modern browsers, and MarkLogic with no modifications to the test code. \n\n`mltap` produces standard [TAP](https://testanything.org) output so you can use it in other tools that can consume TAP, for example, for continuous integration, IDE integration, or reporting.\n\n### Getting Started\n\nFirst, install the libraries and the command-line interface, \n\n```shell\ngit clone https://github.com/jmakeig/mltap.git \u0026\u0026 cd mltap\nnpm install\nnpm run setup\nnpm test\nnpm install --global . # optional\n```\n\nThis installs the the command-line interface on your `$PATH` and configures MarkLogic with the necessary library modules and security settings. You’ll only need to do this once.\n\nThen from within the project you’d like to test,\n\n```shell\nmltap test/*.test.sjs\n```\n\nBehind the scenes, `mltap` will run each of local the `*.test.sjs` modules against the target MarkLogic JavaScript environemnt. `mltap` collates the results and produces a summary of the passed and failed tests in [TAP](https://testanything.org) format to stdout. You can use any TAP consumer to further process the output. For example, [tap-diff](https://www.npmjs.com/package/tap-diff) pretty prints TAP on the command-line.\n\n```shell\nnpm install -g tap-diff\nmltap test/*.test.sjs | tap-diff\n```\n\n### Example Test and TAP Output\n\n\n```js\n'use strict';\n\nconst test = isMarkLogic() ? \n               require('/mltap/test') : \n               require('tape');\n\ntest('Throws an error after some assertions pass', (assert) =\u003e {\n  assert.true(true, 'true is true');\n  throw new Error('Test error');\n  assert.true(!false, 'not false is also true');\n  assert.end();\n});\n\ntest('This test has a fulfilled plan', (assert) =\u003e {\n  assert.plan(2);\n  assert.true('asdf'.length === 4,  'asdf is length 4');\n  assert.true('asdfs'.length === 5, 'asdfs is length 5');\n});\n\ntest('This test has an unfulfilled plan', (assert) =\u003e {\n  assert.plan(25);\n  assert.true('asdf'.length === 4,  'asdf is length 4');\n  assert.true('asdfs'.length === 5, 'asdfs is length 5');\n});\n\n\nfunction isMarkLogic() {try {return xdmp \u0026\u0026 cts;} catch(e) {return false;}}\n```\n\n```\nTAP version 13\n# Throws an error after some assertions pass\nok 1 true is true\nnot ok 2 Error: Test error\n  ---\n    operator: error\n    actual: undefined\n    at: Test.impl (/test/test.test.sjs:9:9)\n    stack: |-\n      Error: Test error\n          at Test.impl (/test/test.test.sjs:9:9)\n          at Test.run (/mltap/test.js:76:12)\n          at Object.run (/mltap/test.js:49:28)\n  ...\n# This test has a fulfilled plan\nok 3 asdf is length 4\nok 4 asdfs is length 5\n# This test has an unfulfilled plan\nok 5 asdf is length 4\nok 6 asdfs is length 5\nnot ok 7 Planned for 25 assertions, got 2\n  ---\n    operator: ok\n    expected: 25\n    actual: 2\n    at: Test.run (/mltap/test.js:81:10)\n  ...\n\n1..7\n```\n\n### Development Set-Up\n\n```shell\ngit clone https://github.com/jmakeig/mltap.git \u0026\u0026 cd mltap\nnpm install\n# Copies the MarkLogic library modules to $ML_HOME/Modules/mltap\n# You’ll need to run this anytime the MarkLogic modules change\n# This should theoretically work with a modules database in the future\nnpm config  # Requires MarkLogic running (defaults to admin:admin@localhost:8000)\nnpm test\n```\n\n#### For VSCode\n\nInstall Node.js TypeScript types to enable code completion,\n\n```shell\nnpm install -g typings\ntypings install dt~node --global\n```\n\nSet up a [task](https://code.visualstudio.com/docs/editor/tasks) to run tests via npm. The most important part is that the **command return the TAP output unaldulterated**, i.e. not reformatted or rewritten, as most console pretty printers will do. Anything that you pipe the TAP output into, such as [tap-notify](https://www.npmjs.com/package/tap-notify), must be a transparent pass-through. The `problemMatcher` below relies on the specific error reporting format of `mltap`, which isn’s wholly standardized in TAP.\n\n```javascript\n{\n  // See https://go.microsoft.com/fwlink/?LinkId=733558\n  // for the documentation about the tasks.json format\n  \"version\": \"0.1.0\",\n  \"command\": \"npm\",\n  \"isShellCommand\": true,\n  \"showOutput\": \"silent\",\n  \"suppressTaskName\": true,\n  \"tasks\": [\n    {\n      \"taskName\": \"test\",\n      \"args\": [\n        \"run\",\n        \"test\"\n      ],\n      \"problemMatcher\": {\n        \"owner\": \"javascript\",\n        \"fileLocation\": [\n          \"relative\",\n          \"${workspaceRoot}\"\n        ],\n        \"pattern\": {\n          \"regexp\": \"^\\\\s+at: (.+) \\\\((.+):(\\\\d+):(\\\\d+)\\\\)\",\n          \"file\": 2,\n          \"line\": 3,\n          \"column\": 4,\n          \"message\": 1\n        }\n      }\n    }\n  ]\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmakeig%2Fmltap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmakeig%2Fmltap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmakeig%2Fmltap/lists"}