marklogic-community / marklogic-unit-test

Automated testing for MarkLogic
https://marklogic-community.github.io/marklogic-unit-test/
Other
13 stars 25 forks source link

test:get-caller breaks when you use a test suite lib that wrappes test-helper #136

Closed grtjn closed 1 year ago

grtjn commented 3 years ago

The get-caller code only filters out test-helper itself from the stack of uris. It should also filter out uris containing /lib/, and if it also ignores /qconsole/ it allows trying out test cases from QC as well.

rjrudin commented 1 year ago

I couldn't reproduce this. My lib:

const test = require("/test/test-helper.xqy");

function foo() {
  return "foo";
}

module.exports = {
  foo
}

My test:

const test = require("/test/test-helper.xqy");
const lib = require("/test/suites/lib.sjs");

console.log("CALLER: " + test.getCaller());

[
  test.assertEqual("foo", lib.foo())
]