diff --git a/src/tests/backend/specs/largePaste.ts b/src/tests/backend/specs/largePaste.ts index d77adc1b9..032620529 100644 --- a/src/tests/backend/specs/largePaste.ts +++ b/src/tests/backend/specs/largePaste.ts @@ -1,7 +1,12 @@ 'use strict'; -const assert = require('assert').strict; -const common = require('../common'); +import {fileURLToPath} from 'node:url'; +import {dirname} from 'node:path'; +import assert from 'assert'; +import common from '../common.js'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); let agent: any; let apiVersion = 1; diff --git a/src/tests/backend/specs/lowerCasePadIds.ts b/src/tests/backend/specs/lowerCasePadIds.ts index 12e8ed831..16e8f0eea 100644 --- a/src/tests/backend/specs/lowerCasePadIds.ts +++ b/src/tests/backend/specs/lowerCasePadIds.ts @@ -1,9 +1,14 @@ 'use strict'; -const assert = require('assert').strict; -const common = require('../common'); -const padManager = require('../../../node/db/PadManager'); -import settings from '../../../node/utils/Settings'; +import {fileURLToPath} from 'node:url'; +import {dirname} from 'node:path'; +import assert from 'assert'; +import common from '../common.js'; +import padManager from '../../../node/db/PadManager.js'; +import settings from '../../../node/utils/Settings.js'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); describe(__filename, function () { let agent:any; diff --git a/src/tests/backend/specs/pads-with-spaces.ts b/src/tests/backend/specs/pads-with-spaces.ts index cfadca1b9..bfcbd09e3 100644 --- a/src/tests/backend/specs/pads-with-spaces.ts +++ b/src/tests/backend/specs/pads-with-spaces.ts @@ -1,6 +1,11 @@ 'use strict'; -const common = require('../common'); +import {fileURLToPath} from 'node:url'; +import {dirname} from 'node:path'; +import common from '../common.js'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); let agent:any; diff --git a/src/tests/backend/specs/regression-db.ts b/src/tests/backend/specs/regression-db.ts index ba50e5240..ac44adf0a 100644 --- a/src/tests/backend/specs/regression-db.ts +++ b/src/tests/backend/specs/regression-db.ts @@ -1,9 +1,16 @@ 'use strict'; -const AuthorManager = require('../../../node/db/AuthorManager'); +import {fileURLToPath} from 'node:url'; +import {dirname} from 'node:path'; +import authorManager from '../../../node/db/AuthorManager.js'; import {strict as assert} from "assert"; -const common = require('../common'); -const db = require('../../../node/db/DB'); +import common from '../common.js'; +import db from '../../../node/db/DB.js'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +const AuthorManager = authorManager; describe(__filename, function () { let setBackup: Function;