-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
basic.ts
53 lines (41 loc) · 1.15 KB
/
basic.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/// <reference types="node" />
import * as Rian from '../async.mjs';
import { exporter } from '../exporter.console.mjs';
Rian.configure('basic', {
'service.version': 'DEV',
});
await Rian.tracer('basic')(async () => {
await Promise.all([
Rian.span('setup')(() => sleep(93)),
Rian.span('bootstrap')(() => sleep(41)),
Rian.span('building')(() => sleep(31)),
]);
await Promise.all([
Rian.span('precompile')(() => sleep(59)),
sleep(23).then(() => Rian.span('verify')(() => sleep(79))),
]);
await Rian.span('spawn thread')(() =>
Rian.tracer('thread #1')(async () =>
Promise.all([
Rian.span('setup')(() => sleep(20)),
Rian.span('bootstrap')(() => sleep(63)),
]),
),
);
Rian.span('doesnt finish');
await Rian.span('running')(() => {
return Rian.span('e2e')(async () => {
await sleep(301);
return Rian.span('snapshot')(() => sleep(36));
});
});
await sleep(10);
await Rian.span(
'url for page /my-product/sleeping-bags-and-tents failed to find a selector',
)(() => sleep(11));
});
Rian.report(exporter(process.stdout.columns));
// --
function sleep(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}