migrate tests to node:test

This commit is contained in:
Girish Ramakrishnan
2026-02-18 22:21:54 +01:00
parent cf0ab16533
commit c176ac600b
94 changed files with 2680 additions and 3553 deletions
+6 -7
View File
@@ -1,15 +1,12 @@
/* global it:false */
import { describe, it, before, after } from 'node:test';
import common from './common.js';
import domains from '../domains.js';
import expect from 'expect.js';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import paths from '../paths.js';
import reverseProxy from '../reverseproxy.js';
/* global describe:false */
/* global before:false */
/* global after:false */
describe('Reverse Proxy', function () {
const { setup, cleanup, domain, auditSource, app } = common;
@@ -27,12 +24,14 @@ describe('Reverse Proxy', function () {
it('configure nginx correctly', async function () {
await reverseProxy.configureApp(app, auditSource);
expect(fs.existsSync(paths.NGINX_APPCONFIG_DIR + '/' + app.id + '.conf'));
const appConfigDir = `${paths.NGINX_APPCONFIG_DIR}/${app.id}`;
assert.ok(fs.existsSync(appConfigDir));
assert.ok(fs.readdirSync(appConfigDir).some((f) => f.endsWith('.conf')));
});
it('unconfigure nginx', async function () {
await reverseProxy.unconfigureApp(app);
expect(!fs.existsSync(paths.NGINX_APPCONFIG_DIR + '/' + app.id + '.conf'));
assert.ok(!fs.existsSync(`${paths.NGINX_APPCONFIG_DIR}/${app.id}`));
});
});
});