diff --git a/__tests__/push/monitor.test.ts b/__tests__/push/monitor.test.ts index 13ac783c..55ba2fa7 100644 --- a/__tests__/push/monitor.test.ts +++ b/__tests__/push/monitor.test.ts @@ -205,8 +205,10 @@ heartbeat.monitors: id: "foo" name: "foo" `); - opts.pattern = '.yaml$'; - const monitors = await createLightweightMonitors(PROJECT_DIR, opts); + const monitors = await createLightweightMonitors(PROJECT_DIR, { + ...opts, + pattern: '.yaml$', + }); expect(monitors.length).toBe(0); }); @@ -221,16 +223,17 @@ heartbeat.monitors: expect(monitors.length).toBe(0); }); - it('skip disabled monitors', async () => { + it('push disabled monitors', async () => { await writeHBFile(` heartbeat.monitors: - type: http + name: "disabled" schedule: "@every 1m" - id: "http" + id: "disabled" enabled: false `); const monitors = await createLightweightMonitors(PROJECT_DIR, opts); - expect(monitors.length).toBe(0); + expect(monitors.length).toBe(1); }); it('prefer local monitor config', async () => { diff --git a/src/push/monitor.ts b/src/push/monitor.ts index 356f7367..f261b0ab 100644 --- a/src/push/monitor.ts +++ b/src/push/monitor.ts @@ -204,11 +204,8 @@ export async function createLightweightMonitors( } for (const monNode of monitorSeq.items) { - // Skip browser monitors and disabled monitors from pushing - if ( - monNode.get('type') === 'browser' || - monNode.get('enabled') === false - ) { + // Skip browser monitors from the YML files + if (monNode.get('type') === 'browser') { continue; } const config = monNode.toJSON();