This commit is contained in:
John Livingston
2021-04-13 18:00:45 +02:00
parent cc21305f6a
commit da37e539f7
2 changed files with 25 additions and 4 deletions

View File

@ -1,4 +1,5 @@
import { getProsodyConfigContent, getProsodyConfigPath, getWorkingDir } from '../prosody/config'
import { testProsodyCorrectlyRunning } from '../prosody/ctl'
import { newResult, TestResult } from './utils'
import * as fs from 'fs'
@ -14,6 +15,7 @@ export async function diagProsody (test: string, options: RegisterServerOptions)
return result
}
// FIXME: these tests should also be in testProsodyCorrectlyRunning
// Testing the prosody config file.
try {
const filePath = await getProsodyConfigPath(options)
@ -34,6 +36,14 @@ export async function diagProsody (test: string, options: RegisterServerOptions)
return result
}
const isCorrectlyRunning = await testProsodyCorrectlyRunning(options)
if (isCorrectlyRunning.messages.length) {
result.messages.push(...isCorrectlyRunning.messages)
}
if (!isCorrectlyRunning.ok) {
return result
}
result.ok = true
return result
}