mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-10-23 01:21:16 +00:00
Docker Hub - Develop / docker-latest (push) Canceled after 0s
GHCR - Development Branches / ghcr-publish (push) Canceled after 0s
Tests / Build & Lint (push) Canceled after 0s
Tests / Unit tests (push) Canceled after 0s
Tests / Integration tests (push) Canceled after 0s
Tests / Application Service Integration tests (push) Canceled after 0s
Validate Docker Build / validate-docker-build (push) Canceled after 0s
* Remove old matrix-protection-suite package aliases. This was leading to issues with monorepo package management. https://github.com/the-draupnir-project/Draupnir/issues/1124 * Fix badly imported symbols from packages that already export them. * Cleanup build command arguments. There was a deprecation warning for short workspaces flag.
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
// Copyright 2022 Gnuxie <Gnuxie@protonmail.com>
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import expect from "expect";
|
|
import { MjolnirAppService } from "../../../src/appservice/AppService";
|
|
import { setupHarness } from "../utils/harness";
|
|
import { isError } from "@the-draupnir-project/matrix-protection-suite";
|
|
import { StringUserID } from "@the-draupnir-project/matrix-basic-types";
|
|
|
|
interface Context extends Mocha.Context {
|
|
appservice?: MjolnirAppService;
|
|
}
|
|
|
|
describe("Just test some commands innit", function () {
|
|
beforeEach(async function (this: Context) {
|
|
this.appservice = await setupHarness();
|
|
});
|
|
afterEach(function (this: Context) {
|
|
if (this.appservice) {
|
|
return this.appservice.close();
|
|
} else {
|
|
console.warn("Missing Appservice in this context, so cannot stop it.");
|
|
return Promise.resolve(); // TS7030: Not all code paths return a value.
|
|
}
|
|
});
|
|
it("Can list any unstarted draupnir", async function (this: Context) {
|
|
const appservice = this.appservice;
|
|
if (appservice === undefined) {
|
|
throw new TypeError(`Test setup failed`);
|
|
}
|
|
const result = await appservice.commands.sendTextCommand(
|
|
"@test:localhost:9999" as StringUserID,
|
|
"!admin list unstarted"
|
|
);
|
|
if (isError(result)) {
|
|
throw new TypeError(`Command should have succeeded`);
|
|
}
|
|
expect(result.ok).toBeInstanceOf(Array);
|
|
});
|
|
});
|