<commit_before>/*!
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Copyright (C) 2022 jeffy-g <<EMAIL>>
  Released under the MIT license
  https://opensource.org/licenses/mit-license.php
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//                                imports.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
import * as grmc from "../src/gulp/";
import {
    task, TGrmcTaskArgs
} from "../scripts/grmc-test-task";
/**
 * @typedef {import("../scripts/grmc-test-task").TGrmcTaskArgs} TGrmcTaskArgs
 */


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//                                  run test
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
describe("rm-sctyle-cmts gulp plugin test", () => {

    /** @type {string | undefined} */
    let envCI: string | undefined;
    beforeAll(() => {
        envCI = process.env.CI;
        console.log("process.env.CI:", envCI);
    });
    afterAll(() => {
        if (typeof envCI === "string") {
            process.env.CI = envCI;
        }
    });
    /**
     * @param {TGrmcTaskArgs} args 
     */
    const tryTask = async (args: TGrmcTaskArgs) => {
        let error: any = null;
        try {
            await task(grmc, args);
        } catch (e: any) {
            error = e;
        }
        expect(error).toBe(null);
    };

    it("Scan the js related files of `node_modules (walkthrough mode)`", async () => {
        process.env.CI = "";
        await tryTask({
            progress: true,
            // showNoops: true,
            // timeMeasure: true,
            collectRegex: true,
            collectJSDocTag: true,
            isWalk: true
        });
    }, 40 * 1000);
    it("Scan the js related files of `node_modules (remove mode)`", async () => {
        grmc.getRmcInterface().reset();
        grmc.noopPaths.length = 0;
        process.env.CI = "1";
        await tryTask({
            progress: true,
            showNoops: true,
            timeMeasure: true,
            // collectRegex: true,
        });
    }, 80 * 1000);
});<commit_msg>when on `CI`<commit_after>/*!
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Copyright (C) 2022 jeffy-g <<EMAIL>>
  Released under the MIT license
  https://opensource.org/licenses/mit-license.php
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//                                imports.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
import * as grmc from "../src/gulp/";
import {
    task, TGrmcTaskArgs
} from "../scripts/grmc-test-task";
/**
 * @typedef {import("../scripts/grmc-test-task").TGrmcTaskArgs} TGrmcTaskArgs
 */


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//                                  run test
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
describe("rm-sctyle-cmts gulp plugin test", () => {

    /** @type {string | undefined} */
    let envCI: string | undefined;
    let onRealCI = false;
    beforeAll(() => {
        envCI = process.env.CI;
        onRealCI = typeof envCI === "string";
        console.log("process.env.CI:", envCI);
    });
    afterAll(() => {
        if (onRealCI) {
            process.env.CI = envCI;
        }
    });
    /**
     * @param {TGrmcTaskArgs} args 
     */
    const tryTask = async (args: TGrmcTaskArgs) => {
        let error: any = null;
        try {
            await task(grmc, args);
        } catch (e: any) {
            error = e;
        }
        expect(error).toBe(null);
    };

    it("Scan the js related files of `node_modules (walkthrough mode)`", async () => {
        onRealCI && (process.env.CI = "");
        await tryTask({
            progress: true,
            // showNoops: true,
            // timeMeasure: true,
            collectRegex: true,
            collectJSDocTag: true,
            isWalk: true
        });
    }, 40 * 1000);
    it("Scan the js related files of `node_modules (remove mode)`", async () => {
        grmc.getRmcInterface().reset();
        grmc.noopPaths.length = 0;
        onRealCI && (process.env.CI = "1");
        await tryTask({
            progress: true,
            showNoops: true,
            timeMeasure: true,
            // collectRegex: true,
        });
    }, 80 * 1000);
});
{'fraction_non_alphanumeric': 0.22342264477095938, 'fraction_numerical': 0.007778738115816767, 'mean_word_length': 0.9832904884318766, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 74, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4785596', 'n_tokens_mistral': 1656, 'n_tokens_neox': 1602, 'n_words': 263}