1 | const { Operation } = require('../src/Operation');
|
2 | const { delay } = require('./utils');
|
3 |
|
4 | class TestOperation extends Operation {
|
5 | async run() {
|
6 | this.result = `my result - ${this.id}`;
|
7 | return this.result;
|
8 | }
|
9 | }
|
10 |
|
11 | class TimeOutOperation extends Operation {
|
12 |
|
13 | constructor(time) {
|
14 | super();
|
15 | this.timer = time;
|
16 | }
|
17 |
|
18 | async run() {
|
19 | return delay(this.time)
|
20 | }
|
21 | }
|
22 |
|
23 | module.exports = {
|
24 | TestOperation,
|
25 | TimeOutOperation
|
26 | } |
\ | No newline at end of file |