Jest

Global setup/teardown

In package.config

"jest": {
    "globalSetup": "./jest-setup.js",
    "globalTeardown": "./jest-teardown.js"
}

// in jest-setup.js and jest-teardown.js
module.exports = async function() {

}

jest.config.js

module.exports =
{
    globalSetup: "./dist/tests/jest.setup.js",
    moduleFileExtensions: ["js", "json"],
    testMatch: [
      "**/dist/**/*.(test|spec).js"
    ],
    testEnvironment: "node",
    testResultsProcessor: "./node_modules/jest-bamboo-formatter"
}