13:55:09.053 All expected events received
13:55:09.053 wait (utils.mjs:333) finished
TypeError: this.resolve is not a function
at Zester.process_event_during_wait (/usr/local/src/git/brastel/kue_job_queue/tests/node_modules/@mayama/zeq/src/index.js:147:22)
at /usr/local/src/git/brastel/kue_job_queue/tests/node_modules/@mayama/zeq/src/index.js:301:22
at new Promise (<anonymous>)
at Zester.wait (/usr/local/src/git/brastel/kue_job_queue/tests/node_modules/@mayama/zeq/src/index.js:298:16)
at create_job (file:///usr/local/src/git/brastel/kue_job_queue/tests/utils.mjs:333:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Module.create_job_and_wait_events (file:///usr/local/src/git/brastel/kue_job_queue/tests/utils.mjs:339:9)
at async test (/usr/local/src/git/brastel/kue_job_queue/tests/functional/create_job_process_channel_rtp.ok.js:87:17)
An error occurred while executing create_job_process_channel_rtp.ok.js
process_event_during_wait(evt) {
this.print_white("")
this.print_white(`wait (${this.current_op_line}) got event:`)
this.print_white(zutil.prettyPrint(evt, 1))
var temp = this.expected_events.slice() // copy array
var matching_errors = []
var matched = false
for(var i=0 ; i<temp.length ; ++i) {
try {
this.print_white("")
this.print_white(`Trying match against expected_events[${i}]:`)
this.print_white(zutil.prettyPrint(temp[i], 1))
if(this.match(temp[i], evt, i)) {
this.print_white(`Match successful`)
this.set_store_vars(this.dict)
this.print_white("")
this.print_green(`wait (${this.current_op_line}) got expected event:`)
this.print_white(zutil.prettyPrint(evt, 1))
this.expected_events.splice(i, 1)
matched = true
break
}
} catch(e) {
if(e instanceof matching.MatchingError) {
this.print_white(`No match: ${e.path}: ${e.reason}`)
matching_errors[i] = e
} else {
this.print_red(e)
clearTimeout(this.timer_id)
this.timer_id = null
this.reject(e)
return
}
}
}
if(matched) {
if(this.expected_events.length == 0) {
this.print_white("All expected events received")
this.print_green(`wait (${this.current_op_line}) finished`)
this.current_op_name = null
clearTimeout(this.timer_id)
this.timer_id = null
this.resolve() //THE PROBLEM HAPPENS HERE
}