<commit_before>import {isBrowser, isNode} from './environment.js';
import Timer from './Timer.js';
import Logger from './Logger.js';
import getLoadControlClass from './LoadControl.js';
import Action from './Action.js';
import stringify from './stringify.js';
import {resetAssertCount, bumpAssertCount, getAssertCount, assert} from './assert.js';
import {getUrlArgs, argsToOptions, processOptions} from './config.js';
import testTypes from './testTypes.js';
import {defTest, orderTests} from './defTests.js';
import {queueActions, getQueuedActions, run, runDefault, getCapabilities} from './runners.js';

const defaultOptions = {
    nameSeparator: '/',
    quitOnFirstFail: false,
    include: [],
    logExcludes: true,
    concurrent: false,
    autoRun: true,
    load: [],
    provider: false,
    capabilities: isNode ? require(`${__dirname}/src/capabilities.js`) : {},
    cap: [],
    capPreset: [],
    user: {}
};

// the test stack which is populated with defTest, defBrowserTest, defBrowserTestRef, defNodeTest, and defRemoteTest
let smokeTests = [];

const LoadControl = getLoadControlClass(
    // log
    // eslint-disable-next-line no-use-before-define
    (...args) => (smoke.logger.log('smoke:load', 0, args)),

    // onResourceLoadComplete
    control => {
        smokeTests.forEach(test => {
            if (!('order' in test)) {
                test.order = 10000 + control.order;
            }
        });
    },

    // onLoadingComplete
    () => (smokeTests = orderTests(smokeTests)),
);

function pause(ms) {
    return new Promise(resolve => {
        setTimeout(resolve, ms);
    });
}

async function loaderIdle() {
    while (!LoadControl.loadingError) {
        const loadingPromise = LoadControl.loadingPromise;
        // eslint-disable-next-line no-await-in-loop
        await loadingPromise;
        // eslint-disable-next-line no-await-in-loop
        await pause(20);
        if (loadingPromise === LoadControl.loadingPromise) {
            break;
        }
    }
    return LoadControl.loadingError;
}


const smoke = {
    get oem() {
        return 'altoviso';
    },
    get version() {
        return '1.2.1';
    },
    isBrowser,
    isNode,

    // eslint-disable-next-line no-undef
    isAmd: isBrowser && typeof define !== 'undefined' && define.amd,

    options: defaultOptions,

    Timer,
    Logger,
    logger: new Logger(defaultOptions),

    testTypes,
    get tests() {
        return smokeTests;
    },

    resetAssertCount,
    bumpAssertCount,
    getAssertCount,
    assert,
<commit_msg>fix: prep for patch release<commit_after>import {isBrowser, isNode} from './environment.js';
import Timer from './Timer.js';
import Logger from './Logger.js';
import getLoadControlClass from './LoadControl.js';
import Action from './Action.js';
import stringify from './stringify.js';
import {resetAssertCount, bumpAssertCount, getAssertCount, assert} from './assert.js';
import {getUrlArgs, argsToOptions, processOptions} from './config.js';
import testTypes from './testTypes.js';
import {defTest, orderTests} from './defTests.js';
import {queueActions, getQueuedActions, run, runDefault, getCapabilities} from './runners.js';

const defaultOptions = {
    nameSeparator: '/',
    quitOnFirstFail: false,
    include: [],
    logExcludes: true,
    concurrent: false,
    autoRun: true,
    load: [],
    provider: false,
    capabilities: isNode ? require(`${__dirname}/src/capabilities.js`) : {},
    cap: [],
    capPreset: [],
    user: {}
};

// the test stack which is populated with defTest, defBrowserTest, defBrowserTestRef, defNodeTest, and defRemoteTest
let smokeTests = [];

const LoadControl = getLoadControlClass(
    // log
    // eslint-disable-next-line no-use-before-define
    (...args) => (smoke.logger.log('smoke:load', 0, args)),

    // onResourceLoadComplete
    control => {
        smokeTests.forEach(test => {
            if (!('order' in test)) {
                test.order = 10000 + control.order;
            }
        });
    },

    // onLoadingComplete
    () => (smokeTests = orderTests(smokeTests)),
);

function pause(ms) {
    return new Promise(resolve => {
        setTimeout(resolve, ms);
    });
}

async function loaderIdle() {
    while (!LoadControl.loadingError) {
        const loadingPromise = LoadControl.loadingPromise;
        // eslint-disable-next-line no-await-in-loop
        await loadingPromise;
        // eslint-disable-next-line no-await-in-loop
        await pause(20);
        if (loadingPromise === LoadControl.loadingPromise) {
            break;
        }
    }
    return LoadControl.loadingError;
}


const smoke = {
    get oem() {
        return 'altoviso';
    },
    get version() {
        return '1.2.2';
    },
    isBrowser,
    isNode,

    // eslint-disable-next-line no-undef
    isAmd: isBrowser && typeof define !== 'undefined' && define.amd,

    options: defaultOptions,

    Timer,
    Logger,
    logger: new Logger(defaultOptions),

    testTypes,
    get tests() {
        return smokeTests;
    },

    resetAssertCount,
    bumpAssertCount,
    getAssertCount,
    assert,

{'fraction_non_alphanumeric': 0.13561643835616438, 'fraction_numerical': 0.004305283757338552, 'mean_word_length': 2.760853568800589, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1399546', 'n_tokens_mistral': 1534, 'n_tokens_neox': 1507, 'n_words': 362}