From fa68c864f14414cf0462ea6a6a3bcb26b222fb99 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 12 Oct 2021 16:24:47 -0400 Subject: [PATCH] test: migration from Python to JavaScript --- Tests/spec/ConfigSpec.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Tests/spec/ConfigSpec.js diff --git a/Tests/spec/ConfigSpec.js b/Tests/spec/ConfigSpec.js new file mode 100644 index 000000000..1cad8626a --- /dev/null +++ b/Tests/spec/ConfigSpec.js @@ -0,0 +1,38 @@ +import config from '../lib/config' + +describe('config tests', function() { + + fit('required configuration parameters', async function() { + expect(config.hostname) + .withContext(`Config 'hostname'`) + .toBeDefined() + expect(config.username) + .withContext(`Config 'username'`) + .toBeDefined() + expect(config.subscriber_username) + .withContext(`Config 'subscriber_username'`) + .toBeDefined() + expect(config.attendee1) + .withContext(`Config 'attendee1'`) + .toBeDefined() + expect(config.attendee1_delegate) + .withContext(`Config 'attendee1_delegate'`) + .toBeDefined() + expect(config.mailserver) + .withContext(`Config 'mailserver'`) + .toBeDefined() + + expect(config.subscriber_username) + .withContext(`Config 'subscriber_username' and 'attendee1_username'`) + .toEqual(config.attendee1_username) + + let userHash = {} + const userList = [config.username, config.subscriber_username, config.attendee1_delegate_username] + for (let user of userList) { + expect(userHash[user]) + .withContext(`username, subscriber_username, attendee1_delegate_username must all be different users ('${user}')`) + .toBeUndefined() + userHash[user] = true + } + }) +}) \ No newline at end of file