From a4bd75e04f328960130876f7f69411fb38a8f8fb Mon Sep 17 00:00:00 2001 From: Will Hunt <will@half-shot.uk> Date: Fri, 26 Oct 2018 00:44:57 +0100 Subject: [PATCH] Test that the minimal and sample configs pass validation --- test/test_configschema.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/test_configschema.ts diff --git a/test/test_configschema.ts b/test/test_configschema.ts new file mode 100644 index 0000000..0533016 --- /dev/null +++ b/test/test_configschema.ts @@ -0,0 +1,22 @@ +import * as yaml from "js-yaml"; +import * as Chai from "chai"; +import { ConfigValidator } from "matrix-appservice-bridge"; + +const expect = Chai.expect; + +describe("ConfigSchema", () => { + const validator = new ConfigValidator("./config/config.schema.yaml"); + it("should successfully validate a minimal config", () => { + const yamlConfig = yaml.safeLoad(` + bridge: + domain: localhost + homeserverUrl: "http://localhost:8008" + auth: + clientID: foo + botToken: foobar`); + validator.validate(yamlConfig); + }); + it("should successfully validate the sample config", () => { + validator.validate("./config/config.sample.yaml"); + }); +}); -- GitLab