mirror of
https://github.com/sern-handler/handler
synced 2026-06-25 01:02:17 +00:00
step 1
This commit is contained in:
@@ -8,15 +8,13 @@ describe('module-loading', () => {
|
||||
const filename = Files.fmtFileName(name+'.'+extension);
|
||||
expect(filename).toBe(name)
|
||||
})
|
||||
|
||||
// todo: handle commands with multiple extensions
|
||||
// it('should properly extract filename from file, nested multiple', () => {
|
||||
// const extension = faker.system.fileExt()
|
||||
// const extension2 = faker.system.fileExt()
|
||||
// const name = faker.system.fileName({ extensionCount: 0 })
|
||||
// const filename = Files.fmtFileName(name+'.'+extension+'.'+extension2);
|
||||
// console.log(filename, name)
|
||||
// expect(filename).toBe(name)
|
||||
//
|
||||
// })
|
||||
it('should get the filename of the commandmodule (linux)', () => {
|
||||
const fname = "///home/pooba/Projects/sern/halibu/dist/commands/ping.js"
|
||||
expect(Files.parseCallsite(fname)).toBe("ping")
|
||||
})
|
||||
it('should get the filename of the commandmodule (windows)', () => {
|
||||
//const fname = "C:\\pooba\\Projects\\sern\\halibu\\dist\\commands\\ping.js"
|
||||
//expect(Files.parseCallsite(fname)).toBe("ping")
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
@@ -2,10 +2,9 @@ import { SpyInstance, afterAll, beforeEach, describe, expect, it, vi } from 'vit
|
||||
import { CoreContainer } from '../../src/core/ioc/container';
|
||||
import { DefaultLogging } from '../../src/core';
|
||||
import { faker } from '@faker-js/faker';
|
||||
import { commandModule } from '../../src';
|
||||
import { commandModule, CommandType } from '../../src';
|
||||
import * as Id from '../../src/core/id';
|
||||
import { CommandMeta } from '../../src/types/core-modules';
|
||||
|
||||
describe('services', () => {
|
||||
//@ts-ignore
|
||||
let container: CoreContainer<Dependencies>;
|
||||
@@ -23,9 +22,9 @@ describe('services', () => {
|
||||
it('module-store.ts', async () => {
|
||||
function createRandomCommandModules() {
|
||||
return commandModule({
|
||||
type: faker.number.int({ min: 1 << 0, max: 1 << 10 }),
|
||||
type: CommandType.Slash,
|
||||
description: faker.string.alpha(),
|
||||
name: faker.string.alpha(),
|
||||
name: faker.string.alpha({ length: { min: 5, max: 10 }}),
|
||||
execute: () => {},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user