odoo-13.0/addons/web/static/tests/helpers/qunit_config.js
/**
 * Waits for the module system to end processing the JS modules, so that we can
 * make the suite fail if some modules couldn't be loaded (e.g. because of a
 * missing dependency).
 *
 * @returns {Promise<boolean>}
 */
Waits for the module system to end processing the JS modules, so that we can
make the suite fail if some modules couldn't be loaded .

@returns {Promise}
Waits for the module system to end processing the JS modules so that we can make the suite fail if some modules couldn ' t be loaded . @returns { Promise }
async function checkModules() {
    $('#qunit-banner').removeClass('qunit-pass');
    const $modulesAlert = $('<div>')
        .addClass('alert alert-info')
        .text('Waiting for modules check...');
    $modulesAlert.appendTo('#qunit');
    await odoo.__DEBUG__.didLogInfo;
    const info = odoo.__DEBUG__.jsModules;
    if (info.missing.length || info.failed.length) {
        $('#qunit-banner').addClass('qunit-fail');
        $modulesAlert.toggleClass('alert-info alert-danger');
        const failingModules = info.missing.concat(info.failed);
        const error = `Some modules couldn't be started: ${failingModules.join(', ')}.`;
        $modulesAlert.text(error);
        errorMessages.unshift(error);
        return false;
    } else {
        $modulesAlert.toggleClass('alert-info alert-success');
        $modulesAlert.text('All modules have been correctly loaded.');
        $('#qunit-banner').addClass('qunit-pass');
        return true;
    }
}
async function checkModules ( ) { $ ( '#qunit-banner' ) . removeClass ( 'qunit-pass' ) ; const $modulesAlert = $ ( '<div>' ) . addClass ( 'alert alert-info' ) . text ( 'Waiting for modules check...' ) ; $modulesAlert . appendTo ( '#qunit' ) ; await odoo . __DEBUG__ . didLogInfo ; const info = odoo . __DEBUG__ . jsModules ; if ( info . missing . length || info . failed . length ) { $ ( '#qunit-banner' ) . addClass ( 'qunit-fail' ) ; $modulesAlert . toggleClass ( 'alert-info alert-danger' ) ; const failingModules = info . missing . concat ( info . failed ) ; const error = ` ${ failingModules . join ( ', ' ) } ` ; $modulesAlert . text ( error ) ; errorMessages . unshift ( error ) ; return false ; } else { $modulesAlert . toggleClass ( 'alert-info alert-success' ) ; $modulesAlert . text ( 'All modules have been correctly loaded.' ) ; $ ( '#qunit-banner' ) . addClass ( 'qunit-pass' ) ; return true ; } }
Waits for the module system to end processing the JS modules, so that we can
 make the suite fail if some modules couldn't be loaded (e.g.
Waits for the module system to end processing the JS modules so that we can make the suite fail if some modules couldn ' t be loaded ( e . g .
// do not mark the suite as successful already, as we still need to ensure // that all modules have been correctly loaded // wait for the module system to end processing the JS modules