2022-06-19 00:25:21 +00:00
|
|
|
import {expect} from "chai";
|
|
|
|
import inputs from "../../../server/plugins/inputs";
|
2019-07-02 16:02:02 +00:00
|
|
|
|
2020-03-21 20:55:36 +00:00
|
|
|
describe("inputs", function () {
|
|
|
|
describe(".getCommands", function () {
|
|
|
|
it("should return a non-empty array", function () {
|
2021-07-04 02:15:33 +00:00
|
|
|
expect(inputs.getCommands()).to.be.an("array").that.is.not.empty;
|
2019-07-02 16:02:02 +00:00
|
|
|
});
|
|
|
|
|
2020-03-21 20:55:36 +00:00
|
|
|
it("should only return strings with no whitespaces and starting with /", function () {
|
2021-07-04 02:15:33 +00:00
|
|
|
inputs.getCommands().forEach((command) => {
|
2020-03-21 20:55:36 +00:00
|
|
|
expect(command).to.be.a("string").that.does.not.match(/\s/);
|
2019-07-02 16:02:02 +00:00
|
|
|
expect(command[0]).to.equal("/");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|