Convert test files to ESM (batch 5 - final): i18n, settings, hooks, webaccess, undo_clear_authorship, specialpages, socketio

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
SamTV12345 2026-04-26 14:07:24 +02:00
parent 37f082e413
commit e6ee5ee72d
7 changed files with 67 additions and 25 deletions

View file

@ -1,11 +1,18 @@
'use strict';
import {fileURLToPath} from 'node:url';
import {dirname} from 'node:path';
import {strict as assert} from 'assert';
const hooks = require('../../../static/js/pluginfw/hooks');
const plugins = require('../../../static/js/pluginfw/plugin_defs');
import hooks from '../../../static/js/pluginfw/hooks.js';
import pluginDefs from '../../../static/js/pluginfw/plugin_defs.js';
import sinon from 'sinon';
import {MapArrayType} from "../../../node/types/MapType";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const plugins = pluginDefs;
interface ExtendedConsole extends Console {
warn: {

View file

@ -1,8 +1,13 @@
'use strict';
const assert = require('assert').strict;
const common = require('../common');
const i18n = require('../../../node/hooks/i18n');
import {fileURLToPath} from 'node:url';
import {dirname} from 'node:path';
import assert from 'assert';
import common from '../common.js';
import i18n from '../../../node/hooks/i18n.js';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
describe(__filename, function () {
before(async function () {

View file

@ -1,10 +1,15 @@
'use strict';
const assert = require('assert').strict;
import {exportedForTestingOnly} from '../../../node/utils/Settings'
import {fileURLToPath} from 'node:url';
import {dirname} from 'node:path';
import assert from 'assert';
import {exportedForTestingOnly} from '../../../node/utils/Settings.js'
import path from 'path';
import process from 'process';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
describe(__filename, function () {
describe('parseSettings', function () {
let settings: any;

View file

@ -1,14 +1,21 @@
'use strict';
import {fileURLToPath} from 'node:url';
import {dirname} from 'node:path';
import {MapArrayType} from "../../../node/types/MapType";
const assert = require('assert').strict;
const common = require('../common');
const padManager = require('../../../node/db/PadManager');
const plugins = require('../../../static/js/pluginfw/plugin_defs');
import readOnlyManager from '../../../node/db/ReadOnlyManager';
import settings from '../../../node/utils/Settings';
const socketIoRouter = require('../../../node/handler/SocketIORouter');
import assert from 'assert';
import common from '../common.js';
import padManager from '../../../node/db/PadManager.js';
import pluginDefs from '../../../static/js/pluginfw/plugin_defs.js';
import readOnlyManager from '../../../node/db/ReadOnlyManager.js';
import settings from '../../../node/utils/Settings.js';
import socketIoRouter from '../../../node/handler/SocketIORouter.js';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const plugins = pluginDefs;
describe(__filename, function () {
this.timeout(30000);

View file

@ -1,10 +1,15 @@
'use strict';
import {fileURLToPath} from 'node:url';
import {dirname} from 'node:path';
import {strict as assert} from 'assert';
import {MapArrayType} from "../../../node/types/MapType";
const common = require('../common');
import settings from '../../../node/utils/Settings';
import common from '../common.js';
import settings from '../../../node/utils/Settings.js';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

View file

@ -1,5 +1,8 @@
'use strict';
import {fileURLToPath} from 'node:url';
import {dirname} from 'node:path';
/**
* Tests for https://github.com/ether/etherpad-lite/issues/2802
*
@ -13,11 +16,14 @@
import {PadType} from "../../../node/types/PadType";
const assert = require('assert').strict;
const common = require('../common');
const padManager = require('../../../node/db/PadManager');
import AttributePool from '../../../static/js/AttributePool';
import padutils from '../../../static/js/pad_utils';
import assert from 'assert';
import common from '../common.js';
import padManager from '../../../node/db/PadManager.js';
import AttributePool from '../../../static/js/AttributePool.js';
import padutils from '../../../static/js/pad_utils.js';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
describe(__filename, function () {
let agent: any;

View file

@ -1,13 +1,20 @@
'use strict';
import {fileURLToPath} from 'node:url';
import {dirname} from 'node:path';
import {MapArrayType} from "../../../node/types/MapType";
import {Func} from "mocha";
import {SettingsUser} from "../../../node/types/SettingsUser";
const assert = require('assert').strict;
const common = require('../common');
const plugins = require('../../../static/js/pluginfw/plugin_defs');
import settings from '../../../node/utils/Settings';
import assert from 'assert';
import common from '../common.js';
import pluginDefs from '../../../static/js/pluginfw/plugin_defs.js';
import settings from '../../../node/utils/Settings.js';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const plugins = pluginDefs;
describe(__filename, function () {
this.timeout(30000);