Skip to content

Commit

Permalink
Fix lightweights
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewvc committed Oct 25, 2024
1 parent a1891ff commit f7797a8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
23 changes: 17 additions & 6 deletions __tests__/utils/test-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export function createTestMonitor(filename: string, type = 'browser') {
type,
schedule: 10,
enabled: true,
serviceName: 'test-service',
locations: ['united_kingdom', 'australia_east'],
privateLocations: ['germany'],
fields: { area: 'website' },
Expand All @@ -53,21 +54,31 @@ export function createTestMonitor(filename: string, type = 'browser') {
return monitor;
}

export function tJourney(status: StatusValue = "succeeded", duration = 0, error?: Error) {
const jj = journey('j1', () => { });
export function tJourney(
status: StatusValue = 'succeeded',
duration = 0,
error?: Error
) {
const jj = journey('j1', () => {});
jj.status = status;
jj.duration = duration;
jj.error = error;
return jj
return jj;
}

export function tStep(status: StatusValue = "succeeded", duration = 0, error?: Error, url?: string, name?: string) {
export function tStep(
status: StatusValue = 'succeeded',
duration = 0,
error?: Error,
url?: string,
name?: string
) {
const ss = step(name ?? 's1', noop);
ss.status = status;
ss.duration = duration;
ss.error = error;
ss.url = url;
return ss
return ss;
}

export class CLIMock {
Expand All @@ -81,7 +92,7 @@ export class CLIMock {
private stderrStr = '';
exitCode: Promise<number>;

constructor(public debug: boolean = false) { }
constructor(public debug: boolean = false) {}

args(a: string[]): CLIMock {
this.cliArgs.push(...a);
Expand Down
2 changes: 1 addition & 1 deletion src/push/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export async function buildMonitorSchema(monitors: Monitor[], isV2: boolean) {
const bundlePath = join(SYNTHETICS_PATH, 'bundles');
await mkdir(bundlePath, { recursive: true });
const bundler = new Bundler();
const schemas: MonitorSchema[] = [];
const schemas: MonitorAPISchema[] = [];

for (const monitor of monitors) {
const { source, config, filter, type } = monitor;
Expand Down

0 comments on commit f7797a8

Please sign in to comment.