create-fluxstack 1.0.1 → 1.0.2
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/create-fluxstack.ts +2 -3
- package/package.json +1 -1
- package/.env +0 -30
- package/LICENSE +0 -21
- package/app/client/README.md +0 -69
- package/app/client/frontend-only.ts +0 -12
- package/app/client/index.html +0 -13
- package/app/client/public/vite.svg +0 -1
- package/app/client/src/App.css +0 -883
- package/app/client/src/App.tsx +0 -669
- package/app/client/src/assets/react.svg +0 -1
- package/app/client/src/components/TestPage.tsx +0 -453
- package/app/client/src/index.css +0 -51
- package/app/client/src/lib/eden-api.ts +0 -110
- package/app/client/src/main.tsx +0 -10
- package/app/client/src/vite-env.d.ts +0 -1
- package/app/client/tsconfig.app.json +0 -43
- package/app/client/tsconfig.json +0 -7
- package/app/client/tsconfig.node.json +0 -25
- package/app/server/app.ts +0 -10
- package/app/server/backend-only.ts +0 -15
- package/app/server/controllers/users.controller.ts +0 -69
- package/app/server/index.ts +0 -104
- package/app/server/routes/index.ts +0 -25
- package/app/server/routes/users.routes.ts +0 -121
- package/app/server/types/index.ts +0 -1
- package/app/shared/types/index.ts +0 -18
- package/bun.lock +0 -1053
- package/core/__tests__/integration.test.ts +0 -227
- package/core/build/index.ts +0 -186
- package/core/cli/command-registry.ts +0 -334
- package/core/cli/index.ts +0 -394
- package/core/cli/plugin-discovery.ts +0 -200
- package/core/client/standalone.ts +0 -57
- package/core/config/__tests__/config-loader.test.ts +0 -591
- package/core/config/__tests__/config-merger.test.ts +0 -657
- package/core/config/__tests__/env-converter.test.ts +0 -372
- package/core/config/__tests__/env-processor.test.ts +0 -431
- package/core/config/__tests__/env.test.ts +0 -452
- package/core/config/__tests__/integration.test.ts +0 -418
- package/core/config/__tests__/loader.test.ts +0 -331
- package/core/config/__tests__/schema.test.ts +0 -129
- package/core/config/__tests__/validator.test.ts +0 -318
- package/core/config/env-dynamic.ts +0 -326
- package/core/config/env.ts +0 -597
- package/core/config/index.ts +0 -317
- package/core/config/loader.ts +0 -546
- package/core/config/runtime-config.ts +0 -322
- package/core/config/schema.ts +0 -694
- package/core/config/validator.ts +0 -540
- package/core/framework/__tests__/server.test.ts +0 -233
- package/core/framework/client.ts +0 -132
- package/core/framework/index.ts +0 -8
- package/core/framework/server.ts +0 -501
- package/core/framework/types.ts +0 -63
- package/core/plugins/__tests__/built-in.test.ts.disabled +0 -366
- package/core/plugins/__tests__/manager.test.ts +0 -398
- package/core/plugins/__tests__/monitoring.test.ts +0 -401
- package/core/plugins/__tests__/registry.test.ts +0 -335
- package/core/plugins/built-in/index.ts +0 -142
- package/core/plugins/built-in/logger/index.ts +0 -180
- package/core/plugins/built-in/monitoring/README.md +0 -193
- package/core/plugins/built-in/monitoring/index.ts +0 -912
- package/core/plugins/built-in/static/index.ts +0 -289
- package/core/plugins/built-in/swagger/index.ts +0 -229
- package/core/plugins/built-in/vite/index.ts +0 -316
- package/core/plugins/config.ts +0 -348
- package/core/plugins/discovery.ts +0 -350
- package/core/plugins/executor.ts +0 -351
- package/core/plugins/index.ts +0 -195
- package/core/plugins/manager.ts +0 -583
- package/core/plugins/registry.ts +0 -424
- package/core/plugins/types.ts +0 -254
- package/core/server/framework.ts +0 -123
- package/core/server/index.ts +0 -8
- package/core/server/plugins/database.ts +0 -182
- package/core/server/plugins/logger.ts +0 -47
- package/core/server/plugins/swagger.ts +0 -34
- package/core/server/standalone.ts +0 -91
- package/core/templates/create-project.ts +0 -455
- package/core/types/api.ts +0 -169
- package/core/types/build.ts +0 -174
- package/core/types/config.ts +0 -68
- package/core/types/index.ts +0 -127
- package/core/types/plugin.ts +0 -94
- package/core/utils/__tests__/errors.test.ts +0 -139
- package/core/utils/__tests__/helpers.test.ts +0 -297
- package/core/utils/__tests__/logger.test.ts +0 -141
- package/core/utils/env-runtime-v2.ts +0 -232
- package/core/utils/env-runtime.ts +0 -252
- package/core/utils/errors/codes.ts +0 -115
- package/core/utils/errors/handlers.ts +0 -63
- package/core/utils/errors/index.ts +0 -81
- package/core/utils/helpers.ts +0 -180
- package/core/utils/index.ts +0 -18
- package/core/utils/logger/index.ts +0 -161
- package/core/utils/logger.ts +0 -106
- package/core/utils/monitoring/index.ts +0 -212
- package/tsconfig.json +0 -51
- package/vite.config.ts +0 -42
|
@@ -1,401 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for Monitoring Plugin
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest'
|
|
6
|
-
import { monitoringPlugin } from '../built-in/monitoring'
|
|
7
|
-
import type { PluginContext, RequestContext, ResponseContext, ErrorContext } from '../types'
|
|
8
|
-
import type { Logger } from '../../utils/logger/index'
|
|
9
|
-
import type { FluxStackConfig } from '../../config/schema'
|
|
10
|
-
|
|
11
|
-
// Mock logger
|
|
12
|
-
const mockLogger: Logger = {
|
|
13
|
-
debug: vi.fn(),
|
|
14
|
-
info: vi.fn(),
|
|
15
|
-
warn: vi.fn(),
|
|
16
|
-
error: vi.fn(),
|
|
17
|
-
child: vi.fn(() => mockLogger),
|
|
18
|
-
time: vi.fn(),
|
|
19
|
-
timeEnd: vi.fn(),
|
|
20
|
-
request: vi.fn()
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Mock utils
|
|
24
|
-
const mockUtils = {
|
|
25
|
-
createTimer: vi.fn(() => ({ end: vi.fn(() => 100) })),
|
|
26
|
-
formatBytes: vi.fn((bytes: number) => `${bytes} bytes`),
|
|
27
|
-
isProduction: vi.fn(() => false),
|
|
28
|
-
isDevelopment: vi.fn(() => true),
|
|
29
|
-
getEnvironment: vi.fn(() => 'development'),
|
|
30
|
-
createHash: vi.fn(() => 'hash123'),
|
|
31
|
-
deepMerge: vi.fn((a, b) => ({ ...a, ...b })),
|
|
32
|
-
validateSchema: vi.fn(() => ({ valid: true, errors: [] }))
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Mock config
|
|
36
|
-
const mockConfig: FluxStackConfig = {
|
|
37
|
-
app: { name: 'test-app', version: '1.0.0' },
|
|
38
|
-
server: {
|
|
39
|
-
port: 3000,
|
|
40
|
-
host: 'localhost',
|
|
41
|
-
apiPrefix: '/api',
|
|
42
|
-
cors: {
|
|
43
|
-
origins: ['*'],
|
|
44
|
-
methods: ['GET', 'POST'],
|
|
45
|
-
headers: ['Content-Type']
|
|
46
|
-
},
|
|
47
|
-
middleware: []
|
|
48
|
-
},
|
|
49
|
-
client: {
|
|
50
|
-
port: 5173,
|
|
51
|
-
proxy: { target: 'http://localhost:3000' },
|
|
52
|
-
build: {
|
|
53
|
-
sourceMaps: true,
|
|
54
|
-
minify: false,
|
|
55
|
-
target: 'esnext',
|
|
56
|
-
outDir: 'dist/client'
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
build: {
|
|
60
|
-
target: 'bun',
|
|
61
|
-
outDir: 'dist',
|
|
62
|
-
optimization: {
|
|
63
|
-
minify: false,
|
|
64
|
-
treeshake: false,
|
|
65
|
-
compress: false,
|
|
66
|
-
splitChunks: false,
|
|
67
|
-
bundleAnalyzer: false
|
|
68
|
-
},
|
|
69
|
-
sourceMaps: true,
|
|
70
|
-
clean: true
|
|
71
|
-
},
|
|
72
|
-
plugins: {
|
|
73
|
-
enabled: [],
|
|
74
|
-
disabled: [],
|
|
75
|
-
config: {
|
|
76
|
-
monitoring: {
|
|
77
|
-
enabled: true,
|
|
78
|
-
httpMetrics: true,
|
|
79
|
-
systemMetrics: true,
|
|
80
|
-
customMetrics: true,
|
|
81
|
-
collectInterval: 1000, // Faster for testing
|
|
82
|
-
retentionPeriod: 5000,
|
|
83
|
-
exporters: [
|
|
84
|
-
{
|
|
85
|
-
type: 'console',
|
|
86
|
-
interval: 2000,
|
|
87
|
-
enabled: true
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
thresholds: {
|
|
91
|
-
responseTime: 500,
|
|
92
|
-
errorRate: 0.1,
|
|
93
|
-
memoryUsage: 0.9,
|
|
94
|
-
cpuUsage: 0.9
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
logging: {
|
|
100
|
-
level: 'info',
|
|
101
|
-
format: 'pretty',
|
|
102
|
-
transports: []
|
|
103
|
-
},
|
|
104
|
-
monitoring: {
|
|
105
|
-
enabled: true,
|
|
106
|
-
metrics: {
|
|
107
|
-
enabled: true,
|
|
108
|
-
collectInterval: 5000,
|
|
109
|
-
httpMetrics: true,
|
|
110
|
-
systemMetrics: true,
|
|
111
|
-
customMetrics: true
|
|
112
|
-
},
|
|
113
|
-
profiling: {
|
|
114
|
-
enabled: false,
|
|
115
|
-
sampleRate: 0.1,
|
|
116
|
-
memoryProfiling: false,
|
|
117
|
-
cpuProfiling: false
|
|
118
|
-
},
|
|
119
|
-
exporters: []
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
describe('Monitoring Plugin', () => {
|
|
124
|
-
let context: PluginContext
|
|
125
|
-
|
|
126
|
-
beforeEach(() => {
|
|
127
|
-
context = {
|
|
128
|
-
config: mockConfig,
|
|
129
|
-
logger: mockLogger,
|
|
130
|
-
app: { use: vi.fn(), get: vi.fn() },
|
|
131
|
-
utils: mockUtils
|
|
132
|
-
}
|
|
133
|
-
vi.clearAllMocks()
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
afterEach(() => {
|
|
137
|
-
// Clean up any intervals that might have been created
|
|
138
|
-
const intervals = (context as any).monitoringIntervals as NodeJS.Timeout[]
|
|
139
|
-
if (intervals) {
|
|
140
|
-
intervals.forEach(interval => clearInterval(interval))
|
|
141
|
-
}
|
|
142
|
-
})
|
|
143
|
-
|
|
144
|
-
describe('Plugin Structure', () => {
|
|
145
|
-
it('should have correct metadata', () => {
|
|
146
|
-
expect(monitoringPlugin.name).toBe('monitoring')
|
|
147
|
-
expect(monitoringPlugin.version).toBe('1.0.0')
|
|
148
|
-
expect(monitoringPlugin.priority).toBe('high')
|
|
149
|
-
expect(monitoringPlugin.category).toBe('monitoring')
|
|
150
|
-
expect(monitoringPlugin.tags).toContain('monitoring')
|
|
151
|
-
expect(monitoringPlugin.tags).toContain('metrics')
|
|
152
|
-
expect(monitoringPlugin.tags).toContain('performance')
|
|
153
|
-
expect(monitoringPlugin.configSchema).toBeDefined()
|
|
154
|
-
expect(monitoringPlugin.defaultConfig).toBeDefined()
|
|
155
|
-
})
|
|
156
|
-
|
|
157
|
-
it('should have all required lifecycle hooks', () => {
|
|
158
|
-
expect(monitoringPlugin.setup).toBeDefined()
|
|
159
|
-
expect(monitoringPlugin.onServerStart).toBeDefined()
|
|
160
|
-
expect(monitoringPlugin.onServerStop).toBeDefined()
|
|
161
|
-
expect(monitoringPlugin.onRequest).toBeDefined()
|
|
162
|
-
expect(monitoringPlugin.onResponse).toBeDefined()
|
|
163
|
-
expect(monitoringPlugin.onError).toBeDefined()
|
|
164
|
-
})
|
|
165
|
-
})
|
|
166
|
-
|
|
167
|
-
describe('Plugin Setup', () => {
|
|
168
|
-
it('should setup successfully when enabled', async () => {
|
|
169
|
-
await monitoringPlugin.setup!(context)
|
|
170
|
-
|
|
171
|
-
expect(mockLogger.info).toHaveBeenCalledWith('Initializing monitoring plugin', expect.any(Object))
|
|
172
|
-
expect(mockLogger.info).toHaveBeenCalledWith('Monitoring plugin initialized successfully')
|
|
173
|
-
expect((context as any).metricsRegistry).toBeDefined()
|
|
174
|
-
})
|
|
175
|
-
|
|
176
|
-
it('should skip setup when disabled', async () => {
|
|
177
|
-
const disabledConfig = {
|
|
178
|
-
...mockConfig,
|
|
179
|
-
plugins: {
|
|
180
|
-
...mockConfig.plugins,
|
|
181
|
-
config: {
|
|
182
|
-
monitoring: {
|
|
183
|
-
enabled: false
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
const disabledContext = { ...context, config: disabledConfig }
|
|
190
|
-
await monitoringPlugin.setup!(disabledContext)
|
|
191
|
-
|
|
192
|
-
expect(mockLogger.info).toHaveBeenCalledWith('Monitoring plugin disabled by configuration')
|
|
193
|
-
expect((disabledContext as any).metricsRegistry).toBeUndefined()
|
|
194
|
-
})
|
|
195
|
-
|
|
196
|
-
it('should initialize metrics registry', async () => {
|
|
197
|
-
await monitoringPlugin.setup!(context)
|
|
198
|
-
|
|
199
|
-
const registry = (context as any).metricsRegistry
|
|
200
|
-
expect(registry).toBeDefined()
|
|
201
|
-
expect(registry.counters).toBeInstanceOf(Map)
|
|
202
|
-
expect(registry.gauges).toBeInstanceOf(Map)
|
|
203
|
-
expect(registry.histograms).toBeInstanceOf(Map)
|
|
204
|
-
})
|
|
205
|
-
})
|
|
206
|
-
|
|
207
|
-
describe('Server Lifecycle', () => {
|
|
208
|
-
beforeEach(async () => {
|
|
209
|
-
await monitoringPlugin.setup!(context)
|
|
210
|
-
})
|
|
211
|
-
|
|
212
|
-
it('should handle server start', async () => {
|
|
213
|
-
await monitoringPlugin.onServerStart!(context)
|
|
214
|
-
|
|
215
|
-
expect(mockLogger.info).toHaveBeenCalledWith(
|
|
216
|
-
'Monitoring plugin: Server monitoring started',
|
|
217
|
-
expect.objectContaining({
|
|
218
|
-
pid: expect.any(Number),
|
|
219
|
-
nodeVersion: expect.any(String),
|
|
220
|
-
platform: expect.any(String)
|
|
221
|
-
})
|
|
222
|
-
)
|
|
223
|
-
|
|
224
|
-
// Check that server start metric was recorded
|
|
225
|
-
const registry = (context as any).metricsRegistry
|
|
226
|
-
expect(registry.counters.size).toBeGreaterThan(0)
|
|
227
|
-
})
|
|
228
|
-
|
|
229
|
-
it('should handle server stop', async () => {
|
|
230
|
-
await monitoringPlugin.onServerStop!(context)
|
|
231
|
-
|
|
232
|
-
expect(mockLogger.info).toHaveBeenCalledWith('Monitoring plugin: Server monitoring stopped')
|
|
233
|
-
|
|
234
|
-
// Check that server stop metric was recorded
|
|
235
|
-
const registry = (context as any).metricsRegistry
|
|
236
|
-
expect(registry.counters.size).toBeGreaterThan(0)
|
|
237
|
-
})
|
|
238
|
-
})
|
|
239
|
-
|
|
240
|
-
describe('HTTP Metrics', () => {
|
|
241
|
-
beforeEach(async () => {
|
|
242
|
-
await monitoringPlugin.setup!(context)
|
|
243
|
-
})
|
|
244
|
-
|
|
245
|
-
it('should record request metrics', async () => {
|
|
246
|
-
const requestContext: RequestContext = {
|
|
247
|
-
request: new Request('http://localhost:3000/test'),
|
|
248
|
-
path: '/test',
|
|
249
|
-
method: 'GET',
|
|
250
|
-
headers: { 'content-length': '100' },
|
|
251
|
-
query: {},
|
|
252
|
-
params: {},
|
|
253
|
-
startTime: Date.now()
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// Add metrics registry to request context for testing
|
|
257
|
-
;(requestContext as any).metricsRegistry = (context as any).metricsRegistry
|
|
258
|
-
|
|
259
|
-
await monitoringPlugin.onRequest!(requestContext)
|
|
260
|
-
|
|
261
|
-
const registry = (context as any).metricsRegistry
|
|
262
|
-
expect(registry.counters.size).toBeGreaterThan(0)
|
|
263
|
-
expect(registry.histograms.size).toBeGreaterThan(0)
|
|
264
|
-
})
|
|
265
|
-
|
|
266
|
-
it('should record response metrics', async () => {
|
|
267
|
-
const responseContext: ResponseContext = {
|
|
268
|
-
request: new Request('http://localhost:3000/test'),
|
|
269
|
-
path: '/test',
|
|
270
|
-
method: 'GET',
|
|
271
|
-
headers: {},
|
|
272
|
-
query: {},
|
|
273
|
-
params: {},
|
|
274
|
-
startTime: Date.now() - 100,
|
|
275
|
-
response: new Response('OK'),
|
|
276
|
-
statusCode: 200,
|
|
277
|
-
duration: 100,
|
|
278
|
-
size: 50
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
// Add metrics registry to response context for testing
|
|
282
|
-
;(responseContext as any).metricsRegistry = (context as any).metricsRegistry
|
|
283
|
-
|
|
284
|
-
await monitoringPlugin.onResponse!(responseContext)
|
|
285
|
-
|
|
286
|
-
const registry = (context as any).metricsRegistry
|
|
287
|
-
expect(registry.counters.size).toBeGreaterThan(0)
|
|
288
|
-
expect(registry.histograms.size).toBeGreaterThan(0)
|
|
289
|
-
})
|
|
290
|
-
|
|
291
|
-
it('should record error metrics', async () => {
|
|
292
|
-
const errorContext: ErrorContext = {
|
|
293
|
-
request: new Request('http://localhost:3000/test'),
|
|
294
|
-
path: '/test',
|
|
295
|
-
method: 'GET',
|
|
296
|
-
headers: {},
|
|
297
|
-
query: {},
|
|
298
|
-
params: {},
|
|
299
|
-
startTime: Date.now() - 100,
|
|
300
|
-
error: new Error('Test error'),
|
|
301
|
-
duration: 100,
|
|
302
|
-
handled: false
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// Add metrics registry to error context for testing
|
|
306
|
-
;(errorContext as any).metricsRegistry = (context as any).metricsRegistry
|
|
307
|
-
|
|
308
|
-
await monitoringPlugin.onError!(errorContext)
|
|
309
|
-
|
|
310
|
-
const registry = (context as any).metricsRegistry
|
|
311
|
-
expect(registry.counters.size).toBeGreaterThan(0)
|
|
312
|
-
expect(registry.histograms.size).toBeGreaterThan(0)
|
|
313
|
-
})
|
|
314
|
-
})
|
|
315
|
-
|
|
316
|
-
describe('System Metrics', () => {
|
|
317
|
-
it('should collect system metrics', async () => {
|
|
318
|
-
await monitoringPlugin.setup!(context)
|
|
319
|
-
|
|
320
|
-
// Wait a bit for system metrics to be collected
|
|
321
|
-
await new Promise(resolve => setTimeout(resolve, 1100))
|
|
322
|
-
|
|
323
|
-
const registry = (context as any).metricsRegistry
|
|
324
|
-
expect(registry.gauges.size).toBeGreaterThan(0)
|
|
325
|
-
|
|
326
|
-
// Check for specific system metrics
|
|
327
|
-
const gaugeKeys = Array.from(registry.gauges.keys()) as string[]
|
|
328
|
-
expect(gaugeKeys.some(key => key.includes('process_memory'))).toBe(true)
|
|
329
|
-
expect(gaugeKeys.some(key => key.includes('process_cpu'))).toBe(true)
|
|
330
|
-
expect(gaugeKeys.some(key => key.includes('process_uptime'))).toBe(true)
|
|
331
|
-
})
|
|
332
|
-
})
|
|
333
|
-
|
|
334
|
-
describe('Metrics Export', () => {
|
|
335
|
-
it('should export metrics to console', async () => {
|
|
336
|
-
await monitoringPlugin.setup!(context)
|
|
337
|
-
|
|
338
|
-
// Wait for export interval
|
|
339
|
-
await new Promise(resolve => setTimeout(resolve, 2100))
|
|
340
|
-
|
|
341
|
-
// Should have logged metrics
|
|
342
|
-
expect(mockLogger.info).toHaveBeenCalledWith(
|
|
343
|
-
'Metrics snapshot',
|
|
344
|
-
expect.objectContaining({
|
|
345
|
-
timestamp: expect.any(String),
|
|
346
|
-
counters: expect.any(Number),
|
|
347
|
-
gauges: expect.any(Number),
|
|
348
|
-
histograms: expect.any(Number),
|
|
349
|
-
metrics: expect.any(Object)
|
|
350
|
-
})
|
|
351
|
-
)
|
|
352
|
-
})
|
|
353
|
-
})
|
|
354
|
-
|
|
355
|
-
describe('Configuration', () => {
|
|
356
|
-
it('should use default configuration when none provided', async () => {
|
|
357
|
-
const contextWithoutConfig = {
|
|
358
|
-
...context,
|
|
359
|
-
config: {
|
|
360
|
-
...mockConfig,
|
|
361
|
-
plugins: {
|
|
362
|
-
...mockConfig.plugins,
|
|
363
|
-
config: {}
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
await monitoringPlugin.setup!(contextWithoutConfig)
|
|
369
|
-
|
|
370
|
-
// Should still initialize with defaults
|
|
371
|
-
expect((contextWithoutConfig as any).metricsRegistry).toBeDefined()
|
|
372
|
-
})
|
|
373
|
-
|
|
374
|
-
it('should merge custom configuration with defaults', async () => {
|
|
375
|
-
const customConfig = {
|
|
376
|
-
...mockConfig,
|
|
377
|
-
plugins: {
|
|
378
|
-
...mockConfig.plugins,
|
|
379
|
-
config: {
|
|
380
|
-
monitoring: {
|
|
381
|
-
enabled: true,
|
|
382
|
-
httpMetrics: false,
|
|
383
|
-
systemMetrics: true
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
const customContext = { ...context, config: customConfig }
|
|
390
|
-
await monitoringPlugin.setup!(customContext)
|
|
391
|
-
|
|
392
|
-
expect(mockLogger.info).toHaveBeenCalledWith(
|
|
393
|
-
'Initializing monitoring plugin',
|
|
394
|
-
expect.objectContaining({
|
|
395
|
-
httpMetrics: false,
|
|
396
|
-
systemMetrics: true
|
|
397
|
-
})
|
|
398
|
-
)
|
|
399
|
-
})
|
|
400
|
-
})
|
|
401
|
-
})
|