2019-02-10 15:26:50 +03:00
|
|
|
import 'jest-extended'
|
|
|
|
import moment from 'moment-timezone'
|
|
|
|
|
|
|
|
import Nlu from '@/core/nlu'
|
|
|
|
import Brain from '@/core/brain'
|
|
|
|
|
|
|
|
jest.setTimeout(60000)
|
|
|
|
|
|
|
|
global.nlu = new Nlu()
|
2022-02-03 14:37:56 +03:00
|
|
|
global.brain = new Brain('en')
|
2022-02-03 15:42:31 +03:00
|
|
|
global.brain.socket.emit = jest.fn()
|
2019-02-10 15:26:50 +03:00
|
|
|
global.nlu.brain = { wernicke: jest.fn(), talk: jest.fn(), socket: { emit: jest.fn() } }
|
|
|
|
global.brain.tts = {
|
|
|
|
synthesizer: jest.fn(),
|
|
|
|
save: jest.fn(),
|
|
|
|
add: jest.fn()
|
|
|
|
}
|
|
|
|
|
|
|
|
global.date = {
|
|
|
|
time_zone: moment.tz.guess()
|
|
|
|
}
|
|
|
|
|
|
|
|
process.env.LEON_LANG = 'en-US'
|
|
|
|
process.env.LEON_TIME_ZONE = global.date.time_zone
|
|
|
|
|
|
|
|
beforeAll(async () => {
|
2021-04-01 12:24:59 +03:00
|
|
|
await global.nlu.loadModel(global.paths.nlp_model)
|
2019-02-10 15:26:50 +03:00
|
|
|
})
|