@outputai/core 0.14.0 → 0.14.1-next.1ec4416.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/credentials/credentials.d.ts +6 -0
  2. package/dist/credentials/credentials.js +87 -0
  3. package/dist/credentials/encrypted_yaml_provider.d.ts +2 -0
  4. package/dist/credentials/encrypted_yaml_provider.js +77 -0
  5. package/dist/credentials/encryption.d.ts +3 -0
  6. package/dist/credentials/encryption.js +6 -0
  7. package/dist/credentials/errors.d.ts +13 -0
  8. package/dist/credentials/errors.js +39 -0
  9. package/dist/credentials/index.d.ts +6 -0
  10. package/dist/credentials/index.js +5 -0
  11. package/dist/credentials/init.d.ts +1 -0
  12. package/dist/credentials/init.js +7 -0
  13. package/dist/credentials/paths.d.ts +7 -0
  14. package/dist/credentials/paths.js +14 -0
  15. package/dist/credentials/provider_registry.d.ts +3 -0
  16. package/dist/credentials/provider_registry.js +6 -0
  17. package/dist/credentials/types.d.ts +12 -0
  18. package/dist/credentials/types.js +1 -0
  19. package/package.json +25 -14
  20. package/src/async_storage.d.ts +4 -0
  21. package/src/consts.js +0 -2
  22. package/src/helpers/object.d.ts +2 -0
  23. package/src/hooks/index.d.ts +0 -8
  24. package/src/hooks/index.js +0 -3
  25. package/src/logger/index.d.ts +4 -0
  26. package/src/worker/index.js +3 -1
  27. package/bin/healthcheck.spec.js +0 -90
  28. package/src/bus.spec.js +0 -196
  29. package/src/errors.spec.js +0 -19
  30. package/src/helpers/activity_options.spec.js +0 -55
  31. package/src/helpers/component.spec.js +0 -54
  32. package/src/helpers/error_serializer.spec.js +0 -479
  33. package/src/helpers/errors.spec.js +0 -189
  34. package/src/helpers/fetch.spec.js +0 -292
  35. package/src/helpers/function.spec.js +0 -24
  36. package/src/helpers/object.spec.js +0 -425
  37. package/src/helpers/promise.spec.js +0 -62
  38. package/src/helpers/redact.spec.js +0 -66
  39. package/src/helpers/string.spec.js +0 -99
  40. package/src/helpers/temporal_context.spec.ts +0 -83
  41. package/src/helpers/trace_info.spec.js +0 -45
  42. package/src/helpers/workflow_context.spec.js +0 -46
  43. package/src/hooks/index.spec.js +0 -265
  44. package/src/hooks/pending_hooks.spec.js +0 -62
  45. package/src/interface/evaluator.spec.js +0 -685
  46. package/src/interface/logger.spec.js +0 -172
  47. package/src/interface/step.spec.js +0 -128
  48. package/src/interface/validations/index.spec.js +0 -197
  49. package/src/interface/validations/schemas.spec.js +0 -229
  50. package/src/interface/webhook.spec.js +0 -170
  51. package/src/interface/workflow.spec.js +0 -710
  52. package/src/interface/workflow_utils.spec.js +0 -271
  53. package/src/interface/zod_integration.spec.js +0 -646
  54. package/src/internal_activities/index.spec.js +0 -186
  55. package/src/logger/development.spec.js +0 -87
  56. package/src/logger/index.spec.js +0 -27
  57. package/src/logger/production.spec.js +0 -71
  58. package/src/sdk/helpers/component_metadata.spec.js +0 -30
  59. package/src/sdk/helpers/objects.spec.js +0 -16
  60. package/src/sdk/helpers/path.spec.js +0 -102
  61. package/src/sdk/runtime/context.spec.js +0 -37
  62. package/src/sdk/runtime/events.spec.js +0 -40
  63. package/src/temporal/client.spec.js +0 -124
  64. package/src/tracing/processors/local/index.spec.js +0 -204
  65. package/src/tracing/processors/s3/configs.spec.js +0 -64
  66. package/src/tracing/processors/s3/index.spec.js +0 -185
  67. package/src/tracing/processors/s3/redis_client.spec.js +0 -179
  68. package/src/tracing/processors/s3/s3_client.spec.js +0 -68
  69. package/src/tracing/tools/build_trace_tree.spec.js +0 -216
  70. package/src/tracing/trace_engine.spec.js +0 -299
  71. package/src/worker/bundle.spec.js +0 -53
  72. package/src/worker/bundler_options.spec.js +0 -62
  73. package/src/worker/catalog_workflow/catalog_publisher.spec.js +0 -317
  74. package/src/worker/catalog_workflow/index.spec.js +0 -222
  75. package/src/worker/configs.spec.js +0 -213
  76. package/src/worker/configs_tuner_schema.spec.js +0 -127
  77. package/src/worker/connection_monitor.spec.js +0 -328
  78. package/src/worker/global_functions.spec.js +0 -55
  79. package/src/worker/index.spec.js +0 -526
  80. package/src/worker/interceptors/activity.spec.js +0 -369
  81. package/src/worker/interceptors/headers.spec.js +0 -73
  82. package/src/worker/interceptors/workflow.spec.js +0 -357
  83. package/src/worker/interruption.spec.js +0 -177
  84. package/src/worker/loader/activities.spec.js +0 -212
  85. package/src/worker/loader/hooks.spec.js +0 -64
  86. package/src/worker/loader/matchers.spec.js +0 -140
  87. package/src/worker/loader/tools.spec.js +0 -595
  88. package/src/worker/loader/workflows.spec.js +0 -287
  89. package/src/worker/log_hooks.spec.js +0 -303
  90. package/src/worker/shutdown.spec.js +0 -197
  91. package/src/worker/sinks.spec.js +0 -220
  92. package/src/worker/telemetry.spec.js +0 -80
  93. package/src/worker/temporal_logger.spec.js +0 -90
  94. package/src/worker/webpack_loaders/tools.spec.js +0 -314
  95. package/src/worker/webpack_loaders/workflow_rewriter/collect_target_imports.spec.js +0 -134
  96. package/src/worker/webpack_loaders/workflow_rewriter/index.spec.js +0 -154
  97. package/src/worker/webpack_loaders/workflow_rewriter/rewrite_activity_calls.spec.js +0 -165
  98. package/src/worker/webpack_loaders/workflow_validator/index.spec.js +0 -202
  99. package/src/worker/webpack_loaders/workflow_validator/npm_workflow_export_resolve.spec.js +0 -374
  100. package/src/worker/worker_runner.spec.js +0 -220
@@ -1,179 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
2
-
3
- const logCalls = { warn: [], error: [] };
4
- vi.mock( '#logger', () => ( {
5
- createChildLogger: () => ( {
6
- warn: ( ...args ) => logCalls.warn.push( args ),
7
- error: ( ...args ) => logCalls.error.push( args )
8
- } )
9
- } ) );
10
-
11
- const getVarsMock = vi.fn();
12
- vi.mock( './configs.js', () => ( { getVars: () => getVarsMock() } ) );
13
-
14
- const createClientImpl = vi.fn();
15
- vi.mock( 'redis', () => ( { createClient: opts => createClientImpl( opts ) } ) );
16
-
17
- async function loadModule() {
18
- vi.resetModules();
19
- return import( './redis_client.js' );
20
- }
21
-
22
- describe( 'tracing/processors/s3/redis_client', () => {
23
- beforeEach( () => {
24
- vi.clearAllMocks();
25
- getVarsMock.mockReturnValue( {} );
26
- logCalls.warn = [];
27
- logCalls.error = [];
28
- } );
29
-
30
- afterEach( () => {
31
- vi.useRealTimers();
32
- } );
33
-
34
- it( 'throws when config redisUrl is missing', async () => {
35
- getVarsMock.mockReturnValue( {} );
36
- const { getRedisClient } = await loadModule();
37
- await expect( getRedisClient() ).rejects.toThrow();
38
- } );
39
-
40
- it( 'creates client with url, connects once, then reuses cached when ping is PONG', async () => {
41
- getVarsMock.mockReturnValue( { redisUrl: 'redis://localhost:6379' } );
42
-
43
- const pingMock = vi.fn().mockResolvedValue( 'PONG' );
44
- const connectMock = vi.fn().mockResolvedValue();
45
- const created = [];
46
- createClientImpl.mockImplementation( opts => {
47
- created.push( opts );
48
- return { connect: connectMock, ping: pingMock };
49
- } );
50
-
51
- const { getRedisClient } = await loadModule();
52
-
53
- const c1 = await getRedisClient();
54
- const c2 = await getRedisClient();
55
-
56
- expect( created ).toHaveLength( 1 );
57
- expect( connectMock ).toHaveBeenCalledTimes( 1 );
58
- expect( pingMock ).toHaveBeenCalledTimes( 1 );
59
- expect( c1 ).toBe( c2 );
60
- expect( created[0] ).toMatchObject( { url: 'redis://localhost:6379', socket: { keepAlive: 15000 } } );
61
- } );
62
-
63
- it( 'closes stale client and reconnects when ping fails', async () => {
64
- getVarsMock.mockReturnValue( { redisUrl: 'redis://localhost:6379' } );
65
-
66
- const quitMock = vi.fn().mockResolvedValue();
67
- const connectMock = vi.fn().mockResolvedValue();
68
- const pingMock = vi.fn()
69
- .mockResolvedValueOnce( 'PONG' )
70
- .mockRejectedValueOnce( new Error( 'Connection lost' ) )
71
- .mockResolvedValueOnce( 'PONG' );
72
-
73
- const created = [];
74
- createClientImpl.mockImplementation( opts => {
75
- created.push( opts );
76
- return { connect: connectMock, ping: pingMock, quit: quitMock };
77
- } );
78
-
79
- const { getRedisClient } = await loadModule();
80
-
81
- const c1 = await getRedisClient();
82
- const c2 = await getRedisClient();
83
- expect( c1 ).toBe( c2 );
84
- expect( created ).toHaveLength( 1 );
85
-
86
- const c3 = await getRedisClient();
87
- expect( quitMock ).toHaveBeenCalledTimes( 1 );
88
- expect( created ).toHaveLength( 2 );
89
- expect( c3 ).not.toBe( c1 );
90
- } );
91
-
92
- it( 'reconnects successfully even when quit() on stale client rejects', async () => {
93
- getVarsMock.mockReturnValue( { redisUrl: 'redis://localhost:6379' } );
94
-
95
- const quitMock = vi.fn().mockRejectedValue( new Error( 'Quit failed' ) );
96
- const connectMock = vi.fn().mockResolvedValue();
97
- const pingMock = vi.fn()
98
- .mockResolvedValueOnce( 'PONG' )
99
- .mockRejectedValueOnce( new Error( 'Connection lost' ) )
100
- .mockResolvedValueOnce( 'PONG' );
101
-
102
- const created = [];
103
- createClientImpl.mockImplementation( opts => {
104
- created.push( opts );
105
- return { connect: connectMock, ping: pingMock, quit: quitMock };
106
- } );
107
-
108
- const { getRedisClient } = await loadModule();
109
-
110
- const c1 = await getRedisClient();
111
- const c1again = await getRedisClient();
112
- expect( c1 ).toBe( c1again );
113
- expect( created ).toHaveLength( 1 );
114
-
115
- const c2 = await getRedisClient();
116
- expect( quitMock ).toHaveBeenCalledTimes( 1 );
117
- expect( created ).toHaveLength( 2 );
118
- expect( c2 ).not.toBe( c1 );
119
- } );
120
-
121
- it( 'wraps connect() errors with code and cleans up failed client', async () => {
122
- getVarsMock.mockReturnValue( { redisUrl: 'redis://localhost:6379' } );
123
-
124
- const connectErr = new Error( 'Connection refused' );
125
- connectErr.code = 'ECONNREFUSED';
126
- const connectMock = vi.fn().mockRejectedValue( connectErr );
127
- const quitMock = vi.fn().mockResolvedValue();
128
-
129
- createClientImpl.mockImplementation( () => ( {
130
- connect: connectMock,
131
- quit: quitMock
132
- } ) );
133
-
134
- const { getRedisClient } = await loadModule();
135
-
136
- try {
137
- await getRedisClient();
138
- expect.fail( 'Should have thrown' );
139
- } catch ( err ) {
140
- expect( err.message ).toBe( 'Failed to connect to Redis: Connection refused (ECONNREFUSED)' );
141
- expect( err.cause ).toBe( connectErr );
142
- }
143
-
144
- expect( quitMock ).toHaveBeenCalledTimes( 1 );
145
- } );
146
-
147
- it( 'logs ping failures with error level', async () => {
148
- getVarsMock.mockReturnValue( { redisUrl: 'redis://localhost:6379' } );
149
-
150
- const pingErr = new Error( 'Connection reset' );
151
- pingErr.code = 'ECONNRESET';
152
- const pingMock = vi.fn()
153
- .mockResolvedValueOnce( 'PONG' )
154
- .mockRejectedValueOnce( pingErr )
155
- .mockResolvedValueOnce( 'PONG' );
156
- const connectMock = vi.fn().mockResolvedValue();
157
- const quitMock = vi.fn().mockResolvedValue();
158
-
159
- createClientImpl.mockImplementation( () => ( {
160
- connect: connectMock,
161
- ping: pingMock,
162
- quit: quitMock
163
- } ) );
164
-
165
- const { getRedisClient } = await loadModule();
166
-
167
- // First call: state.client is null, creates client (no ping)
168
- await getRedisClient();
169
- // Second call: pings existing client, returns PONG
170
- await getRedisClient();
171
- // Third call: pings existing client, fails with pingErr, reconnects
172
- await getRedisClient();
173
-
174
- expect( logCalls.error ).toContainEqual( [
175
- 'Redis ping failed',
176
- { error: 'Connection reset', code: 'ECONNRESET' }
177
- ] );
178
- } );
179
- } );
@@ -1,68 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach } from 'vitest';
2
-
3
- const getVarsMock = vi.fn();
4
- vi.mock( './configs', () => ( { getVars: () => getVarsMock() } ) );
5
-
6
- const ctorState = { args: null };
7
- class S3ClientMock {
8
- constructor( args ) {
9
- ctorState.args = args;
10
- }
11
- }
12
- vi.mock( '@aws-sdk/client-s3', () => ( {
13
- S3Client: S3ClientMock
14
- } ) );
15
-
16
- const uploadDoneMock = vi.fn();
17
- const uploadCtorState = { args: [] };
18
- class UploadMock {
19
- constructor( args ) {
20
- uploadCtorState.args.push( args );
21
- }
22
-
23
- done = uploadDoneMock;
24
- }
25
- vi.mock( '@aws-sdk/lib-storage', () => ( { Upload: UploadMock } ) );
26
-
27
- async function loadModule() {
28
- vi.resetModules();
29
- return import( './s3_client.js' );
30
- }
31
-
32
- describe( 'tracing/processors/s3/s3_client', () => {
33
- beforeEach( () => {
34
- vi.clearAllMocks();
35
- ctorState.args = null;
36
- uploadCtorState.args = [];
37
- uploadDoneMock.mockResolvedValue( undefined );
38
- getVarsMock.mockReturnValue( {
39
- awsRegion: 'us-east-1',
40
- awsAccessKeyId: 'id',
41
- awsSecretAccessKey: 'sek',
42
- remoteS3Bucket: 'bucket'
43
- } );
44
- } );
45
-
46
- it( 'creates client once with config and uploads with bucket/key/content', async () => {
47
- const { upload } = await loadModule();
48
-
49
- await upload( { key: 'wf/key.json', content: '{"a":1}' } );
50
-
51
- expect( ctorState.args ).toEqual( {
52
- region: 'us-east-1',
53
- credentials: { secretAccessKey: 'sek', accessKeyId: 'id' }
54
- } );
55
- expect( uploadCtorState.args ).toHaveLength( 1 );
56
- expect( uploadCtorState.args[0] ).toEqual( {
57
- client: expect.any( S3ClientMock ),
58
- params: { Bucket: 'bucket', Key: 'wf/key.json', Body: '{"a":1}' }
59
- } );
60
- expect( uploadDoneMock ).toHaveBeenCalledTimes( 1 );
61
-
62
- // subsequent upload uses cached client
63
- await upload( { key: 'wf/key2.json', content: '{}' } );
64
- expect( uploadCtorState.args ).toHaveLength( 2 );
65
- expect( uploadDoneMock ).toHaveBeenCalledTimes( 2 );
66
- } );
67
- } );
68
-
@@ -1,216 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { EventAction } from '../trace_consts.js';
3
- import { Attribute } from '#trace_attribute';
4
- import buildTraceTree from './build_trace_tree.js';
5
-
6
- describe( 'build_trace_tree', () => {
7
- it( 'returns null when entries is empty', () => {
8
- expect( buildTraceTree( [] ) ).toBeNull();
9
- } );
10
-
11
- it( 'sets root output with a fixed message when workflow has no end/error action yet', () => {
12
- const entries = [
13
- { kind: 'workflow', id: 'wf', parentId: undefined, action: EventAction.START, name: 'wf', details: {}, timestamp: 1000 }
14
- ];
15
- const result = buildTraceTree( entries );
16
- expect( result ).not.toBeNull();
17
- expect( result.output ).toBe( '<<Workflow did not finish yet. If this workflows is supposed to have been completed already, \
18
- this can indicate it timed out or was interrupted.>>' );
19
- expect( result.endedAt ).toBeNull();
20
- } );
21
-
22
- it( 'returns null when there is no root (all entries have parentId)', () => {
23
- const entries = [
24
- { id: 'a', parentId: 'x', action: EventAction.START, name: 'a', timestamp: 1 },
25
- { id: 'b', parentId: 'a', action: EventAction.START, name: 'b', timestamp: 2 }
26
- ];
27
- expect( buildTraceTree( entries ) ).toBeNull();
28
- } );
29
-
30
- it( 'add_attr action stores attribute details by type on node.attributes', () => {
31
- const requestCount = {
32
- type: Attribute.HTTPRequestCount.TYPE,
33
- url: 'https://api.example.test',
34
- requestId: 'req-1'
35
- };
36
- const requestCost = {
37
- type: Attribute.HTTPRequestCost.TYPE,
38
- url: 'https://api.example.test',
39
- requestId: 'req-1',
40
- total: 0.2
41
- };
42
- const entries = [
43
- { kind: 'workflow', id: 'wf', parentId: undefined, action: EventAction.START, name: 'wf', details: {}, timestamp: 100 },
44
- { kind: 'step', id: 's', parentId: 'wf', action: EventAction.START, name: 'step', details: {}, timestamp: 200 },
45
- { id: 's', action: EventAction.ADD_ATTR, details: requestCount, timestamp: 250 },
46
- { id: 's', action: EventAction.ADD_ATTR, details: requestCost, timestamp: 260 },
47
- { id: 'wf', action: EventAction.END, details: {}, timestamp: 300 }
48
- ];
49
- const result = buildTraceTree( entries );
50
- expect( result ).not.toBeNull();
51
- expect( result.children[0].attributes ).toEqual( {
52
- [Attribute.HTTPRequestCount.TYPE]: requestCount,
53
- [Attribute.HTTPRequestCost.TYPE]: requestCost
54
- } );
55
- } );
56
-
57
- it( 'add_attr action overwrites prior value for the same attribute type', () => {
58
- const firstCost = {
59
- type: Attribute.HTTPRequestCost.TYPE,
60
- url: 'https://api.example.test',
61
- requestId: 'req-1',
62
- total: 1
63
- };
64
- const secondCost = {
65
- type: Attribute.HTTPRequestCost.TYPE,
66
- url: 'https://api.example.test',
67
- requestId: 'req-1',
68
- total: 2
69
- };
70
- const entries = [
71
- { kind: 'workflow', id: 'wf', parentId: undefined, action: EventAction.START, name: 'wf', details: {}, timestamp: 1 },
72
- { id: 'wf', action: EventAction.ADD_ATTR, details: firstCost, timestamp: 2 },
73
- { id: 'wf', action: EventAction.ADD_ATTR, details: secondCost, timestamp: 3 },
74
- { id: 'wf', action: EventAction.END, details: {}, timestamp: 4 }
75
- ];
76
- const result = buildTraceTree( entries );
77
- expect( result.attributes ).toEqual( { [Attribute.HTTPRequestCost.TYPE]: secondCost } );
78
- } );
79
-
80
- it( 'add_attr does not attach nodes as children (only start does)', () => {
81
- const entries = [
82
- { kind: 'workflow', id: 'wf', parentId: undefined, action: EventAction.START, name: 'wf', details: {}, timestamp: 1 },
83
- {
84
- id: 'orphan',
85
- parentId: 'wf',
86
- action: EventAction.ADD_ATTR,
87
- details: { type: Attribute.HTTPRequestCount.TYPE, url: 'https://api.example.test', requestId: 'req-1' },
88
- timestamp: 2
89
- },
90
- { id: 'wf', action: EventAction.END, details: {}, timestamp: 3 }
91
- ];
92
- const result = buildTraceTree( entries );
93
- expect( result.children ).toHaveLength( 0 );
94
- expect( result.attributes ).toEqual( {} );
95
- } );
96
-
97
- it( 'error action sets error and endedAt on node', () => {
98
- const entries = [
99
- { kind: 'wf', id: 'r', parentId: undefined, action: EventAction.START, name: 'root', details: {}, timestamp: 100 },
100
- { kind: 'step', id: 's', parentId: 'r', action: EventAction.START, name: 'step', details: {}, timestamp: 200 },
101
- { id: 's', action: EventAction.ERROR, details: { message: 'failed' }, timestamp: 300 }
102
- ];
103
- const result = buildTraceTree( entries );
104
- expect( result ).not.toBeNull();
105
- expect( result.children ).toHaveLength( 1 );
106
- expect( result.children[0].error ).toEqual( { message: 'failed' } );
107
- expect( result.children[0].endedAt ).toBe( 300 );
108
- } );
109
-
110
- it( 'builds a tree from workflow/step/IO entries with grouping and sorting', () => {
111
- const stepAttribute = {
112
- type: Attribute.HTTPRequestCount.TYPE,
113
- url: 'https://api.example.test/step-1',
114
- requestId: 'req-step-1'
115
- };
116
- const entries = [
117
- // workflow start
118
- { kind: 'workflow', action: EventAction.START, name: 'wf', id: 'wf', parentId: undefined, details: { a: 1 }, timestamp: 1000 },
119
- // evaluator start/stop
120
- { kind: 'evaluator', action: EventAction.START, name: 'eval', id: 'eval', parentId: 'wf', details: { z: 0 }, timestamp: 1500 },
121
- { id: 'eval', action: EventAction.END, details: { z: 1 }, timestamp: 1600 },
122
- // step1 start
123
- { kind: 'step', action: EventAction.START, name: 'step-1', id: 's1', parentId: 'wf', details: { x: 1 }, timestamp: 2000 },
124
- { id: 's1', action: EventAction.ADD_ATTR, details: stepAttribute, timestamp: 2050 },
125
- // IO under step1
126
- { kind: 'IO', action: EventAction.START, name: 'test-1', id: 'io1', parentId: 's1', details: { y: 2 }, timestamp: 2300 },
127
- // step2 start
128
- { kind: 'step', action: EventAction.START, name: 'step-2', id: 's2', parentId: 'wf', details: { x: 2 }, timestamp: 2400 },
129
- // IO under step2
130
- { kind: 'IO', action: EventAction.START, name: 'test-2', id: 'io2', parentId: 's2', details: { y: 3 }, timestamp: 2500 },
131
- { id: 'io2', action: EventAction.END, details: { y: 4 }, timestamp: 2600 },
132
- // IO under step1 ends
133
- { id: 'io1', action: EventAction.END, details: { y: 5 }, timestamp: 2700 },
134
- // step1 end
135
- { id: 's1', action: EventAction.END, details: { done: true }, timestamp: 2800 },
136
- // step2 end
137
- { id: 's2', action: EventAction.END, details: { done: true }, timestamp: 2900 },
138
- // workflow end
139
- { id: 'wf', action: EventAction.END, details: { ok: true }, timestamp: 3000 }
140
- ];
141
-
142
- const result = buildTraceTree( entries );
143
-
144
- const expected = {
145
- id: 'wf',
146
- kind: 'workflow',
147
- name: 'wf',
148
- startedAt: 1000,
149
- endedAt: 3000,
150
- input: { a: 1 },
151
- output: { ok: true },
152
- attributes: {},
153
- children: [
154
- {
155
- id: 'eval',
156
- kind: 'evaluator',
157
- name: 'eval',
158
- startedAt: 1500,
159
- endedAt: 1600,
160
- input: { z: 0 },
161
- output: { z: 1 },
162
- attributes: {},
163
- children: []
164
- },
165
- {
166
- id: 's1',
167
- kind: 'step',
168
- name: 'step-1',
169
- startedAt: 2000,
170
- endedAt: 2800,
171
- input: { x: 1 },
172
- output: { done: true },
173
- attributes: { [Attribute.HTTPRequestCount.TYPE]: stepAttribute },
174
- children: [
175
- {
176
- id: 'io1',
177
- kind: 'IO',
178
- name: 'test-1',
179
- startedAt: 2300,
180
- endedAt: 2700,
181
- input: { y: 2 },
182
- output: { y: 5 },
183
- attributes: {},
184
- children: []
185
- }
186
- ]
187
- },
188
- {
189
- id: 's2',
190
- kind: 'step',
191
- name: 'step-2',
192
- startedAt: 2400,
193
- endedAt: 2900,
194
- input: { x: 2 },
195
- output: { done: true },
196
- attributes: {},
197
- children: [
198
- {
199
- id: 'io2',
200
- kind: 'IO',
201
- name: 'test-2',
202
- startedAt: 2500,
203
- endedAt: 2600,
204
- input: { y: 3 },
205
- output: { y: 4 },
206
- attributes: {},
207
- children: []
208
- }
209
- ]
210
- }
211
- ]
212
- };
213
-
214
- expect( result ).toMatchObject( expected );
215
- } );
216
- } );