<commit_before>"use strict";

const {strict: assert} = require("assert");

const {mock_module, zrequire} = require("../zjsunit/namespace");
const {run_test} = require("../zjsunit/test");

const reload_state = mock_module("reload_state", {
    is_in_progress: () => false,
});

const people = zrequire("people");

const me = {
    email: "<EMAIL>",
    user_id: 30,
    full_name: "<NAME>",
    timezone: "America/Los_Angeles",
};

people.init();
people.add_active_user(me);
people.initialize_current_user(me.user_id);

run_test("report_late_add", () => {
    blueslip.expect("error", "Added user late: user_id=55 email=<EMAIL>");
    people.report_late_add(55, "<EMAIL>");

    blueslip.expect("log", "Added user late: user_id=55 email=<EMAIL>");
    reload_state.is_in_progress = () => true;<commit_msg>minor: Use override in people_errors.<commit_after>"use strict";

const {strict: assert} = require("assert");

const {mock_module, zrequire} = require("../zjsunit/namespace");
const {run_test} = require("../zjsunit/test");

const reload_state = mock_module("reload_state", {
    is_in_progress: () => false,
});

const people = zrequire("people");

const me = {
    email: "<EMAIL>",
    user_id: 30,
    full_name: "<NAME>",
    timezone: "America/Los_Angeles",
};

people.init();
people.add_active_user(me);
people.initialize_current_user(me.user_id);

run_test("report_late_add", (override) => {
    blueslip.expect("error", "Added user late: user_id=55 email=<EMAIL>");
    people.report_late_add(55, "<EMAIL>");

    blueslip.expect("log", "Added user late: user_id=55 email=<EMAIL>");
    override(reload_state, "is_in_progress", () => true);
{'fraction_non_alphanumeric': 0.18523002421307505, 'fraction_numerical': 0.009685230024213076, 'mean_word_length': 5.285171102661597, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, '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': '5888910', 'n_tokens_mistral': 593, 'n_tokens_neox': 575, 'n_words': 107}