mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
fix: tests
This commit is contained in:
parent
0971ac4e94
commit
a523ef65f5
7 changed files with 9 additions and 16 deletions
|
|
@ -1,16 +1,10 @@
|
|||
import path, {dirname} from 'node:path';
|
||||
import {once} from 'node:events';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import {createRequire} from 'node:module';
|
||||
import test from 'supertape';
|
||||
import io from 'socket.io-client';
|
||||
import {connect} from '../before.mjs';
|
||||
import {createConfig} from '../../server/config.mjs';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
const require = createRequire(import.meta.url);
|
||||
const configPath = path.join(__dirname, '../..', 'server', 'config');
|
||||
const configFn = require(configPath).createConfig();
|
||||
const configFn = createConfig();
|
||||
|
||||
test('cloudcmd: console: enabled', async (t) => {
|
||||
const config = {
|
||||
|
|
|
|||
|
|
@ -4,15 +4,14 @@ import {fileURLToPath} from 'node:url';
|
|||
import serveOnce from 'serve-once';
|
||||
import {test, stub} from 'supertape';
|
||||
import cloudcmd from '../../server/cloudcmd.mjs';
|
||||
import modulas from '../../server/modulas.mjs';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
const require = createRequire(import.meta.url);
|
||||
const cloudcmdPath = join(__dirname, '..', '..');
|
||||
|
||||
const modulesPath = join(cloudcmdPath, 'json', 'modules.json');
|
||||
const localModules = require(modulesPath);
|
||||
const modulas = require(`../../server/modulas`);
|
||||
|
||||
const {request} = serveOnce(cloudcmd, {
|
||||
config: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue