MCPcopy
hub / github.com/docmirror/dev-sidecar / run

Method run

packages/core/src/modules/plugin/free-eye/template.js:25–45  ·  view source on GitHub ↗
(func, args)

Source from the content-addressed store, hash-verified

23 }
24
25 async run (func, args) {
26 const timeoutPromise = new Promise((_, reject) => {
27 setTimeout(() => {
28 this.timeoutEvent.isSet = true
29 reject(new Error('Test timed out!'))
30 }, this.timeout)
31 })
32
33 try {
34 await Promise.race([
35 func(this.timeoutEvent, this.log.bind(this), this.results, ...args),
36 timeoutPromise,
37 ])
38 } catch (error) {
39 if (error.message === 'Test timed out!') {
40 this.log('Test timed out!')
41 } else {
42 this.log(`Test failed: ${error.message}`)
43 }
44 }
45 }
46}
47
48export class TestGroup {

Callers 1

constructorMethod · 0.95

Calls 1

logMethod · 0.95

Tested by

no test coverage detected