migrate tests to node:test
This commit is contained in:
@@ -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}`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user