digital-workers 2.1.3 → 2.3.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.
- package/CHANGELOG.md +9 -0
- package/README.md +2 -0
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +33 -21
- package/dist/actions.js.map +1 -1
- package/dist/agent-comms.d.ts.map +1 -1
- package/dist/agent-comms.js +36 -25
- package/dist/agent-comms.js.map +1 -1
- package/dist/approve.d.ts +40 -8
- package/dist/approve.d.ts.map +1 -1
- package/dist/approve.js +86 -20
- package/dist/approve.js.map +1 -1
- package/dist/ask.d.ts +38 -7
- package/dist/ask.d.ts.map +1 -1
- package/dist/ask.js +85 -25
- package/dist/ask.js.map +1 -1
- package/dist/browse.d.ts +223 -0
- package/dist/browse.d.ts.map +1 -0
- package/dist/browse.js +392 -0
- package/dist/browse.js.map +1 -0
- package/dist/capability-tiers.js +3 -3
- package/dist/capability-tiers.js.map +1 -1
- package/dist/cascade-context.d.ts +28 -28
- package/dist/client.d.ts +162 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +64 -0
- package/dist/client.js.map +1 -0
- package/dist/decide.d.ts +42 -6
- package/dist/decide.d.ts.map +1 -1
- package/dist/decide.js +54 -11
- package/dist/decide.js.map +1 -1
- package/dist/do.d.ts +36 -7
- package/dist/do.d.ts.map +1 -1
- package/dist/do.js +82 -39
- package/dist/do.js.map +1 -1
- package/dist/error-escalation.d.ts.map +1 -1
- package/dist/error-escalation.js +38 -38
- package/dist/error-escalation.js.map +1 -1
- package/dist/generate.d.ts +48 -7
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +49 -8
- package/dist/generate.js.map +1 -1
- package/dist/goals.d.ts +10 -9
- package/dist/goals.d.ts.map +1 -1
- package/dist/goals.js +30 -24
- package/dist/goals.js.map +1 -1
- package/dist/image.d.ts +189 -0
- package/dist/image.d.ts.map +1 -0
- package/dist/image.js +528 -0
- package/dist/image.js.map +1 -0
- package/dist/index.d.ts +49 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +58 -2
- package/dist/index.js.map +1 -1
- package/dist/is.d.ts +45 -10
- package/dist/is.d.ts.map +1 -1
- package/dist/is.js +56 -21
- package/dist/is.js.map +1 -1
- package/dist/kpis.d.ts +24 -15
- package/dist/kpis.d.ts.map +1 -1
- package/dist/kpis.js +16 -14
- package/dist/kpis.js.map +1 -1
- package/dist/load-balancing.d.ts.map +1 -1
- package/dist/load-balancing.js +124 -38
- package/dist/load-balancing.js.map +1 -1
- package/dist/logger.d.ts +76 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +39 -0
- package/dist/logger.js.map +1 -0
- package/dist/notify.d.ts +38 -9
- package/dist/notify.d.ts.map +1 -1
- package/dist/notify.js +72 -17
- package/dist/notify.js.map +1 -1
- package/dist/role.d.ts +5 -4
- package/dist/role.d.ts.map +1 -1
- package/dist/role.js +13 -10
- package/dist/role.js.map +1 -1
- package/dist/runtime.d.ts +310 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +510 -0
- package/dist/runtime.js.map +1 -0
- package/dist/team.d.ts +11 -6
- package/dist/team.d.ts.map +1 -1
- package/dist/team.js +22 -15
- package/dist/team.js.map +1 -1
- package/dist/transports/email.d.ts +318 -0
- package/dist/transports/email.d.ts.map +1 -0
- package/dist/transports/email.js +779 -0
- package/dist/transports/email.js.map +1 -0
- package/dist/transports/slack.d.ts +515 -0
- package/dist/transports/slack.d.ts.map +1 -0
- package/dist/transports/slack.js +844 -0
- package/dist/transports/slack.js.map +1 -0
- package/dist/transports.d.ts.map +1 -1
- package/dist/transports.js +44 -25
- package/dist/transports.js.map +1 -1
- package/dist/types.d.ts +141 -19
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/id.d.ts +19 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/id.js +21 -0
- package/dist/utils/id.js.map +1 -0
- package/dist/video.d.ts +203 -0
- package/dist/video.d.ts.map +1 -0
- package/dist/video.js +528 -0
- package/dist/video.js.map +1 -0
- package/dist/worker.d.ts +343 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +698 -0
- package/dist/worker.js.map +1 -0
- package/package.json +32 -14
- package/src/actions.ts +39 -30
- package/src/agent-comms.ts +54 -92
- package/src/approve.ts +91 -20
- package/src/ask.ts +99 -25
- package/src/browse.ts +627 -0
- package/src/capability-tiers.ts +5 -5
- package/src/client.ts +221 -0
- package/src/decide.ts +81 -35
- package/src/do.ts +98 -52
- package/src/error-escalation.ts +55 -67
- package/src/generate.ts +52 -18
- package/src/goals.ts +36 -27
- package/src/image.ts +816 -0
- package/src/index.ts +187 -2
- package/src/is.ts +59 -25
- package/src/kpis.ts +41 -36
- package/src/load-balancing.ts +132 -46
- package/src/logger.ts +93 -0
- package/src/notify.ts +78 -17
- package/src/role.ts +30 -20
- package/src/runtime.ts +796 -0
- package/src/team.ts +24 -19
- package/src/transports/email.ts +1160 -0
- package/src/transports/slack.ts +1320 -0
- package/src/transports.ts +58 -43
- package/src/types.ts +174 -46
- package/src/utils/id.ts +21 -0
- package/src/video.ts +906 -0
- package/src/worker.ts +1007 -0
- package/test/approve.test.ts +305 -0
- package/test/ask.test.ts +274 -0
- package/test/browse.test.ts +361 -0
- package/test/decide.test.ts +252 -0
- package/test/do.test.ts +144 -0
- package/test/error-logging.test.ts +357 -0
- package/test/generate.test.ts +319 -0
- package/test/image.test.ts +398 -0
- package/test/is.test.ts +287 -0
- package/test/load-balancing-safety.test.ts +404 -0
- package/test/notify.test.ts +434 -0
- package/test/primitives.test.ts +320 -0
- package/test/runtime-integration.test.ts +892 -0
- package/test/transports/crypto.test.ts +230 -0
- package/test/transports/email.test.ts +866 -0
- package/test/transports/id-generation.test.ts +91 -0
- package/test/transports/slack.test.ts +760 -0
- package/test/type-safety.test.ts +834 -0
- package/test/types.test.ts +60 -2
- package/test/video.test.ts +530 -0
- package/test/worker.test.ts +1433 -0
- package/tsconfig.json +4 -1
- package/vitest.config.ts +42 -0
- package/wrangler.jsonc +36 -0
- package/.turbo/turbo-build.log +0 -4
- package/LICENSE +0 -21
- package/src/actions.js +0 -436
- package/src/approve.js +0 -234
- package/src/ask.js +0 -226
- package/src/decide.js +0 -244
- package/src/do.js +0 -227
- package/src/generate.js +0 -298
- package/src/goals.js +0 -205
- package/src/index.js +0 -68
- package/src/is.js +0 -317
- package/src/kpis.js +0 -270
- package/src/notify.js +0 -219
- package/src/role.js +0 -110
- package/src/team.js +0 -130
- package/src/transports.js +0 -357
- package/src/types.js +0 -71
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comprehensive integration tests for all 7 digital-workers primitives
|
|
3
|
+
*
|
|
4
|
+
* This file provides a unified test suite that validates all worker primitives
|
|
5
|
+
* work together correctly. The 7 primitives are:
|
|
6
|
+
*
|
|
7
|
+
* 1. do - Task execution/routing
|
|
8
|
+
* 2. is - Type validation
|
|
9
|
+
* 3. ask - Question routing
|
|
10
|
+
* 4. approve - Approval workflows
|
|
11
|
+
* 5. decide - Decision making
|
|
12
|
+
* 6. generate - Content generation
|
|
13
|
+
* 7. notify - Notification delivery
|
|
14
|
+
*
|
|
15
|
+
* These tests use real AI calls via the Cloudflare AI Gateway.
|
|
16
|
+
* Tests are skipped if AI_GATEWAY_URL is not configured.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { describe, it, expect } from 'vitest'
|
|
20
|
+
import { do as doTask, is, ask, approve, decide, generate, notify } from '../src/index.js'
|
|
21
|
+
import type { Worker, WorkerTeam } from '../src/types.js'
|
|
22
|
+
|
|
23
|
+
// Skip tests if no gateway configured
|
|
24
|
+
const hasGateway = !!process.env.AI_GATEWAY_URL || !!process.env.ANTHROPIC_API_KEY
|
|
25
|
+
|
|
26
|
+
// Common test fixtures
|
|
27
|
+
const testWorker: Worker = {
|
|
28
|
+
id: 'test-worker',
|
|
29
|
+
name: 'Test Worker',
|
|
30
|
+
type: 'human',
|
|
31
|
+
status: 'available',
|
|
32
|
+
contacts: {
|
|
33
|
+
email: 'test@example.com',
|
|
34
|
+
slack: '@test',
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const testTeam: WorkerTeam = {
|
|
39
|
+
id: 'test-team',
|
|
40
|
+
name: 'Test Team',
|
|
41
|
+
members: [testWorker],
|
|
42
|
+
contacts: {
|
|
43
|
+
slack: '#test-team',
|
|
44
|
+
email: 'team@example.com',
|
|
45
|
+
},
|
|
46
|
+
lead: testWorker,
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
describe('Digital Workers - All 7 Primitives', () => {
|
|
50
|
+
describe('Exports', () => {
|
|
51
|
+
it('should export all 7 primitives', () => {
|
|
52
|
+
expect(doTask).toBeDefined()
|
|
53
|
+
expect(is).toBeDefined()
|
|
54
|
+
expect(ask).toBeDefined()
|
|
55
|
+
expect(approve).toBeDefined()
|
|
56
|
+
expect(decide).toBeDefined()
|
|
57
|
+
expect(generate).toBeDefined()
|
|
58
|
+
expect(notify).toBeDefined()
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
it('all primitives should be functions', () => {
|
|
62
|
+
expect(typeof doTask).toBe('function')
|
|
63
|
+
expect(typeof is).toBe('function')
|
|
64
|
+
expect(typeof ask).toBe('function')
|
|
65
|
+
expect(typeof approve).toBe('function')
|
|
66
|
+
expect(typeof decide).toBe('function')
|
|
67
|
+
expect(typeof generate).toBe('function')
|
|
68
|
+
expect(typeof notify).toBe('function')
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
describe('Return Types', () => {
|
|
73
|
+
it('do() returns TaskResult', async () => {
|
|
74
|
+
const result = await doTask('Test task', { timeout: 1 })
|
|
75
|
+
expect(result).toHaveProperty('success')
|
|
76
|
+
expect(result).toHaveProperty('duration')
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
it('is() returns TypeCheckResult', async () => {
|
|
80
|
+
const result = await is('test', 'string')
|
|
81
|
+
expect(result).toHaveProperty('valid')
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
it('ask() returns AskResult', async () => {
|
|
85
|
+
const result = await ask(testWorker, 'Test question?', { via: 'slack' })
|
|
86
|
+
expect(result).toHaveProperty('answer')
|
|
87
|
+
expect(result).toHaveProperty('answeredBy')
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
it('approve() returns ApprovalResult', async () => {
|
|
91
|
+
const result = await approve('Test request', testWorker, { via: 'slack' })
|
|
92
|
+
expect(result).toHaveProperty('approved')
|
|
93
|
+
expect(result).toHaveProperty('approvedBy')
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
it('notify() returns NotifyResult', async () => {
|
|
97
|
+
const result = await notify(testWorker, 'Test message', { via: 'slack' })
|
|
98
|
+
expect(result).toHaveProperty('sent')
|
|
99
|
+
expect(result).toHaveProperty('via')
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
describe.skipIf(!hasGateway)('Integration - AI-powered Primitives', () => {
|
|
104
|
+
it('decide() returns Decision', async () => {
|
|
105
|
+
const result = await decide({
|
|
106
|
+
options: ['A', 'B'],
|
|
107
|
+
context: 'Simple choice test',
|
|
108
|
+
})
|
|
109
|
+
expect(result).toHaveProperty('choice')
|
|
110
|
+
expect(result).toHaveProperty('reasoning')
|
|
111
|
+
expect(result).toHaveProperty('confidence')
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
it('generate() returns GenerateResult', async () => {
|
|
115
|
+
const result = await generate('Say hello', { type: 'text' })
|
|
116
|
+
expect(result).toHaveProperty('content')
|
|
117
|
+
expect(result).toHaveProperty('type')
|
|
118
|
+
expect(result).toHaveProperty('metadata')
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
it('ask.ai() returns answer directly', async () => {
|
|
122
|
+
const answer = await ask.ai('What is 1+1?')
|
|
123
|
+
expect(answer).toBeDefined()
|
|
124
|
+
expect(typeof answer).toBe('string')
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
describe('Method Chains', () => {
|
|
129
|
+
it('do has parallel, sequence, withDependencies', () => {
|
|
130
|
+
expect(doTask.parallel).toBeDefined()
|
|
131
|
+
expect(doTask.sequence).toBeDefined()
|
|
132
|
+
expect(doTask.withDependencies).toBeDefined()
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
it('is has email, url, date, custom', () => {
|
|
136
|
+
expect(is.email).toBeDefined()
|
|
137
|
+
expect(is.url).toBeDefined()
|
|
138
|
+
expect(is.date).toBeDefined()
|
|
139
|
+
expect(is.custom).toBeDefined()
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
it('ask has ai, batch, clarify, yesNo, choose', () => {
|
|
143
|
+
expect(ask.ai).toBeDefined()
|
|
144
|
+
expect(ask.batch).toBeDefined()
|
|
145
|
+
expect(ask.clarify).toBeDefined()
|
|
146
|
+
expect(ask.yesNo).toBeDefined()
|
|
147
|
+
expect(ask.choose).toBeDefined()
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
it('approve has withContext, batch, withDeadline, any, all', () => {
|
|
151
|
+
expect(approve.withContext).toBeDefined()
|
|
152
|
+
expect(approve.batch).toBeDefined()
|
|
153
|
+
expect(approve.withDeadline).toBeDefined()
|
|
154
|
+
expect(approve.any).toBeDefined()
|
|
155
|
+
expect(approve.all).toBeDefined()
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
it('decide has yesNo, prioritize, withApproval', () => {
|
|
159
|
+
expect(decide.yesNo).toBeDefined()
|
|
160
|
+
expect(decide.prioritize).toBeDefined()
|
|
161
|
+
expect(decide.withApproval).toBeDefined()
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
it('generate has variations, withTone, forAudience, withLength, refine', () => {
|
|
165
|
+
expect(generate.variations).toBeDefined()
|
|
166
|
+
expect(generate.withTone).toBeDefined()
|
|
167
|
+
expect(generate.forAudience).toBeDefined()
|
|
168
|
+
expect(generate.withLength).toBeDefined()
|
|
169
|
+
expect(generate.refine).toBeDefined()
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
it('notify has alert, info, rich, batch, schedule', () => {
|
|
173
|
+
expect(notify.alert).toBeDefined()
|
|
174
|
+
expect(notify.info).toBeDefined()
|
|
175
|
+
expect(notify.rich).toBeDefined()
|
|
176
|
+
expect(notify.batch).toBeDefined()
|
|
177
|
+
expect(notify.schedule).toBeDefined()
|
|
178
|
+
})
|
|
179
|
+
})
|
|
180
|
+
|
|
181
|
+
describe('Worker/Team Target Resolution', () => {
|
|
182
|
+
it('ask resolves Worker target', async () => {
|
|
183
|
+
const result = await ask(testWorker, 'Question?', { via: 'slack' })
|
|
184
|
+
expect(result.answeredBy?.id).toBe('test-worker')
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
it('ask resolves Team to lead', async () => {
|
|
188
|
+
const result = await ask(testTeam, 'Team question?', { via: 'slack' })
|
|
189
|
+
expect(result.answeredBy?.id).toBe('test-worker')
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
it('ask throws for string target without contacts', async () => {
|
|
193
|
+
// String targets don't have contacts configured
|
|
194
|
+
await expect(ask('string-id', 'Question?')).rejects.toThrow('No valid channel available')
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
it('approve resolves Worker target', async () => {
|
|
198
|
+
const result = await approve('Request', testWorker, { via: 'slack' })
|
|
199
|
+
expect(result.approvedBy?.id).toBe('test-worker')
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
it('notify resolves Worker target', async () => {
|
|
203
|
+
const result = await notify(testWorker, 'Message', { via: 'slack' })
|
|
204
|
+
expect(result.recipients?.[0].id).toBe('test-worker')
|
|
205
|
+
})
|
|
206
|
+
})
|
|
207
|
+
|
|
208
|
+
describe('Channel Resolution', () => {
|
|
209
|
+
it('uses specified channel when available', async () => {
|
|
210
|
+
const result = await notify(testWorker, 'Test', { via: 'email' })
|
|
211
|
+
expect(result.via).toContain('email')
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
it('falls back to available channel', async () => {
|
|
215
|
+
const result = await notify(testWorker, 'Test')
|
|
216
|
+
expect(result.via.length).toBeGreaterThan(0)
|
|
217
|
+
})
|
|
218
|
+
|
|
219
|
+
it('handles channel array', async () => {
|
|
220
|
+
const result = await notify(testWorker, 'Test', { via: ['slack', 'email'] })
|
|
221
|
+
expect(result.via).toContain('slack')
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
it('throws when no channel available', async () => {
|
|
225
|
+
const noChannelWorker: Worker = {
|
|
226
|
+
id: 'no-channel',
|
|
227
|
+
name: 'No Channel',
|
|
228
|
+
type: 'human',
|
|
229
|
+
status: 'available',
|
|
230
|
+
contacts: {},
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
await expect(ask(noChannelWorker, 'Question?')).rejects.toThrow()
|
|
234
|
+
})
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
describe.skipIf(!hasGateway)('End-to-End Workflow', () => {
|
|
238
|
+
it('can validate, decide, and notify', async () => {
|
|
239
|
+
// Step 1: Validate input
|
|
240
|
+
const validation = await is('test@example.com', 'email')
|
|
241
|
+
expect(validation.valid).toBe(true)
|
|
242
|
+
|
|
243
|
+
// Step 2: Make a decision
|
|
244
|
+
const decision = await decide({
|
|
245
|
+
options: ['approve', 'reject'],
|
|
246
|
+
context: 'Should we process this email?',
|
|
247
|
+
})
|
|
248
|
+
expect(['approve', 'reject']).toContain(decision.choice)
|
|
249
|
+
|
|
250
|
+
// Step 3: Notify about the decision
|
|
251
|
+
const notification = await notify(testWorker, `Decision: ${decision.choice}`, {
|
|
252
|
+
via: 'slack',
|
|
253
|
+
})
|
|
254
|
+
expect(notification.sent).toBe(true)
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
it('can generate content and validate it', async () => {
|
|
258
|
+
// Step 1: Generate content
|
|
259
|
+
const content = await generate('Generate an email address', {
|
|
260
|
+
type: 'structured',
|
|
261
|
+
schema: { email: 'A valid email address' },
|
|
262
|
+
})
|
|
263
|
+
expect(content.content).toBeDefined()
|
|
264
|
+
|
|
265
|
+
// Step 2: Validate the generated email
|
|
266
|
+
const generated = content.content as { email: string }
|
|
267
|
+
if (generated.email) {
|
|
268
|
+
const validation = await is.email(generated.email)
|
|
269
|
+
// The generated email may or may not be valid format
|
|
270
|
+
expect(validation).toBeDefined()
|
|
271
|
+
}
|
|
272
|
+
})
|
|
273
|
+
})
|
|
274
|
+
|
|
275
|
+
describe('Type Safety', () => {
|
|
276
|
+
it('do returns typed result', async () => {
|
|
277
|
+
const result = await doTask<string>('Test', { timeout: 1 })
|
|
278
|
+
// result.result should be typed as string
|
|
279
|
+
expect(result).toBeDefined()
|
|
280
|
+
})
|
|
281
|
+
|
|
282
|
+
it('ask returns typed answer', async () => {
|
|
283
|
+
const result = await ask<string>(testWorker, 'Question?', { via: 'slack' })
|
|
284
|
+
// result.answer should be typed as string
|
|
285
|
+
expect(result).toBeDefined()
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
it('throws for unsupported image type (tests error handling)', async () => {
|
|
289
|
+
// This tests type safety in error conditions
|
|
290
|
+
await expect(generate('Generate image', { type: 'image' })).rejects.toThrow(
|
|
291
|
+
'not yet implemented'
|
|
292
|
+
)
|
|
293
|
+
})
|
|
294
|
+
})
|
|
295
|
+
|
|
296
|
+
describe('Error Handling', () => {
|
|
297
|
+
it('is handles validation errors gracefully', async () => {
|
|
298
|
+
const result = await is('invalid', 'number')
|
|
299
|
+
expect(result.valid).toBe(false)
|
|
300
|
+
expect(result.errors).toBeDefined()
|
|
301
|
+
})
|
|
302
|
+
|
|
303
|
+
it('notify handles missing channels gracefully', async () => {
|
|
304
|
+
const noChannelWorker: Worker = {
|
|
305
|
+
id: 'no-channel',
|
|
306
|
+
name: 'No Channel',
|
|
307
|
+
type: 'human',
|
|
308
|
+
status: 'available',
|
|
309
|
+
contacts: {},
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const result = await notify(noChannelWorker, 'Test')
|
|
313
|
+
expect(result.sent).toBe(false)
|
|
314
|
+
})
|
|
315
|
+
|
|
316
|
+
it('generate throws for unsupported types', async () => {
|
|
317
|
+
await expect(generate('Test', { type: 'image' })).rejects.toThrow()
|
|
318
|
+
})
|
|
319
|
+
})
|
|
320
|
+
})
|