Skip to content

Commit

Permalink
use dev errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-Arc committed Sep 24, 2024
1 parent 868117b commit d31b4f4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions apps/server/src/services/report-service/ReportService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,25 @@ export function clear(id?: string) {
}

export function eventStart(state: RuntimeState) {
// eslint-disable-next-line no-unused-labels -- dev code path
DEV: {
if (state.eventNow === null) {
throw new Error('report.eventStart: called without eventNow present');
}
}

report.set(state.eventNow.id, { ...blankReportData, startAt: state.timer.startedAt });
}

export function eventStop(state: RuntimeState) {
if (state.eventNow?.id === undefined) {
return;
// eslint-disable-next-line no-unused-labels -- dev code path
DEV: {
if (state.eventNow === null) {
throw new Error('report.eventStop: called without eventNow present');

Check failure on line 38 in apps/server/src/services/report-service/ReportService.ts

View workflow job for this annotation

GitHub Actions / unit-test

src/stores/__tests__/runtimeState.test.ts > mutation on runtimeState > playback operations > normal playback cycle

Error: report.eventStop: called without eventNow present ❯ Module.eventStop src/services/report-service/ReportService.ts:38:13 ❯ Module.load src/stores/runtimeState.ts:177:10 ❯ src/stores/__tests__/runtimeState.test.ts:97:7

Check failure on line 38 in apps/server/src/services/report-service/ReportService.ts

View workflow job for this annotation

GitHub Actions / unit-test

src/stores/__tests__/runtimeState.test.ts > mutation on runtimeState > playback operations > runtime offset

Error: report.eventStop: called without eventNow present ❯ Module.eventStop src/services/report-service/ReportService.ts:38:13 ❯ Module.load src/stores/runtimeState.ts:177:10 ❯ src/stores/__tests__/runtimeState.test.ts:172:7

Check failure on line 38 in apps/server/src/services/report-service/ReportService.ts

View workflow job for this annotation

GitHub Actions / unit-test

src/stores/__tests__/runtimeState.test.ts > roll mode > roll takover > from load

Error: report.eventStop: called without eventNow present ❯ Module.eventStop src/services/report-service/ReportService.ts:38:13 ❯ Module.load src/stores/runtimeState.ts:177:10 ❯ src/stores/__tests__/runtimeState.test.ts:283:7

Check failure on line 38 in apps/server/src/services/report-service/ReportService.ts

View workflow job for this annotation

GitHub Actions / unit-test

src/stores/__tests__/runtimeState.test.ts > roll mode > roll takover > from play

Error: report.eventStop: called without eventNow present ❯ Module.eventStop src/services/report-service/ReportService.ts:38:13 ❯ Module.load src/stores/runtimeState.ts:177:10 ❯ src/stores/__tests__/runtimeState.test.ts:292:7

Check failure on line 38 in apps/server/src/services/report-service/ReportService.ts

View workflow job for this annotation

GitHub Actions / unit-test

src/stores/__tests__/runtimeState.test.ts > roll mode > roll continue with offset > no gaps

Error: report.eventStop: called without eventNow present ❯ Module.eventStop src/services/report-service/ReportService.ts:38:13 ❯ Module.load src/stores/runtimeState.ts:177:10 ❯ src/stores/__tests__/runtimeState.test.ts:308:7
}
}

//TODO: How should pauses be calculated into the report?
const prevReport = report.get(state.eventNow.id);
if (prevReport !== undefined && prevReport.startAt !== null) {
prevReport.endAt = state.clock;
Expand Down

0 comments on commit d31b4f4

Please sign in to comment.