1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-01 03:15:58 +03:00

chore: do not execute any module during the NLP testing

This commit is contained in:
Louistiti 2019-04-27 21:46:05 +08:00
parent da2e7e935d
commit 8f3bb5ab80

View File

@ -56,7 +56,6 @@ describe('NLU modules', () => {
// eslint-disable-next-line no-loop-func
describe(`${modules[k]} module`, () => {
const exprs = expressions[modules[k]]
let isModuleExecutedOnce = false
for (let l = 0; l < exprs.length; l += 1) {
// eslint-disable-next-line no-loop-func
@ -67,19 +66,6 @@ describe('NLU modules', () => {
await nlu.process(exprs[l])
const [obj] = nlu.brain.execute.mock.calls
// Execute/test each module one time (otherwise this test would be slow)
if (isModuleExecutedOnce === false) {
try {
await brain.execute(obj[0]) // eslint-disable-line no-await-in-loop
expect(brain.talk).toHaveBeenCalled()
} catch (e) {
// expect() just to break the test if the module execution fails
expect(brain.talk).toBe(false)
}
isModuleExecutedOnce = true
}
expect(obj[0].classification.package).toBe(packages[j])
expect(obj[0].classification.module).toBe(modules[k])
})