we are trying to add tests to out internal applica...
# suitescript
s
we are trying to add tests to out internal application for suite script and was wondering how to have unit tests that are built on top of Netsuite module for example
Copy code
function openSuitle(id, invoice, type = "Bill") {
    return url.resolveScript({
      scriptId: **********,
      deploymentId: "************",
      returnExternalUrl: false,
      params: {
        recid: id,
        invoice: invoice,
        type: type,
      },
    });
  }
e
This is not a function I would unit test, personally. You're just re-testing that
resolveScript()
works. It's not our job to unit test the SuiteScript API, and there's no recourse you can take if it fails. That said, in order to test this function, you'll have to mock the
url
module and its
resolveScript
function.
You can mock modules using a virtual mock at the top of your test suite like so
Assuming you're using jest, I suppose