MCPcopy Create free account
hub / github.com/codecombat/codecombat / constructor

Method constructor

test/app/lib/cinematic/commandRunner.spec.js:15–27  ·  view source on GitHub ↗
(spyRunner, ms, spyCancel)

Source from the content-addressed store, hash-verified

13// Command that we use to test commandRunner functionality.
14class SpyCommand extends AbstractCommand {
15 constructor (spyRunner, ms, spyCancel) {
16 super()
17 this.run = () => sleep(ms).then(spyRunner)
18
19 // We can also spy on cancel calls.
20 if (typeof spyCancel === 'function') {
21 this.cancel = promise => {
22 promise.cancel()
23 spyCancel()
24 return Promise.resolve()
25 }
26 }
27 }
28}
29
30describe('commandRunner', () => {

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.70
cancelMethod · 0.45

Tested by

no test coverage detected