-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathtest.ts
More file actions
27 lines (26 loc) · 865 Bytes
/
test.ts
File metadata and controls
27 lines (26 loc) · 865 Bytes
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
import { expect, it } from 'vitest';
import { createRunner } from '../../../runner';
it('traces a durable object method', async () => {
const runner = createRunner(__dirname)
.expect(envelope => {
const transactionEvent = envelope[1]?.[0]?.[1];
expect(transactionEvent).toEqual(
expect.objectContaining({
contexts: expect.objectContaining({
trace: expect.objectContaining({
op: 'rpc',
data: expect.objectContaining({
'sentry.op': 'rpc',
'sentry.origin': 'auto.faas.cloudflare_durableobjects',
}),
origin: 'auto.faas.cloudflare_durableobjects',
}),
}),
transaction: 'sayHello',
}),
);
})
.start();
await runner.makeRequest('get', '/hello');
await runner.completed();
});