No Padding Margin


    1.0.1 • Public • Published


    A support lib for mocha as test runner in map.apps based projects. See how to write tests. The runner initializes the bdd test style of mocha.


    If the module is available within the js-registry, tests can be executed with an URL like this:


    This URL will load a test-init.js file, which configures the AMD loader. It will enable the intern adapter to allow execution of old intern based tests. And it executes all tests specified by apprt-core/tests/intern-all.

    Possible URL parameters are:

    Name Description
    boot comma separated list of initialization files
    test comma separated list tests to load
    grep A regular expressions, which filters the tests to execute
    timeout default global timeout of test executions, defaults to 5000msec
    reporter the reporter to use, defaults to 'html'. Use 'tap' for puppeteer test execution, see
    reportOnEnd Flag for the 'html' reporter. Use reportOnEnd=false, to enable appending the test reports during test execution (note: reduces performance)
    registerInternAdapter Flag to register an amd module which mocks 'intern!object' and 'intern/chai!assert' imports and converts intern tests into mocha bdd tests


    The 'mapapps-mocha-runner' requires the packages 'mocha' and 'chai' to work correctly. Both packages must be available in one of the js-registries.

    The packages are normally made available inside a project using the packages.json:

    "devDependencies": {
            "@conterra/mapapps-mocha-runner": "^1.0.0",
            "chai": "^4.3.4",
            "mocha": "^9.0.0"

    Additionally, the js-registry needs to be configured to serve these packages. This part depends on the registry implementation used and can be configured. If the java (embedded) js-registry (since 1.4.3) is used, there are two properties, which allow the scanning of the 'node_modules' folder for dev dependencies:


    If the browser-sync js-registry is used, then in the gulpfile.js the packages needs to be listed:

            port: 8080,
            jsreg: {
                npmModules: ["mocha", "chai", "@conterra/mapapps-mocha-runner"]


    A test-init.js is responsible to configure the AMD loader, and e.g. define which js-registries should be requested for packages. It may look like:

        // (optional) load apprt-polyfill before all tests start
        deps: ["apprt-polyfill"],
        // (optional) which js registry should be requested for packages
        // if left out the default registry and and all packages within the registry are registered
        jsregistry: [
                // (optional) if left out the default registry is used
                root: "url to registry..",
                // packages: ["*"] means all packages of the registry
                packages: [
                    // list of packages registered from this registry
        // (optional) register custom manual packages
        packages: [
                name: "test-apps",
                location: "@@application.base.url@@/js/tests/test-apps"



    npm i @conterra/mapapps-mocha-runner

    DownloadsWeekly Downloads






    Unpacked Size

    28 kB

    Total Files


    Last publish


    • a.frank
    • jessebluemr
    • schneiderlars
    • julkuh
    • m-scherpi
    • mbeckem_conterra
    • conterrade