Skip to content

Commit

Permalink
Don't set VX_MACHINE_TYPE within ScannerStore mocks
Browse files Browse the repository at this point in the history
Since we might instantiate both a MockCentralScannerStore and a
MockPrecinctScannerStore
  • Loading branch information
arsalansufi committed Oct 13, 2023
1 parent c1adcbb commit 82fb427
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 3 additions & 0 deletions libs/backend/src/cast_vote_records/export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ let mockUsbDrive: MockUsbDrive;
let tempDirectoryPath: string;

beforeEach(() => {
// While this should technically be set to "central-scan" for tests emulating VxCentralScan
// behavior, always using "scan" is fine for the purposes of these tests.
process.env['VX_MACHINE_TYPE'] = 'scan';
mockFeatureFlagger.resetFeatureFlags();

mockUsbDrive = createMockUsbDrive();
Expand Down
8 changes: 1 addition & 7 deletions libs/backend/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,7 @@ class MockScannerStore implements ScannerStore {
/**
* A mock central scanner store
*/
export class MockCentralScannerStore extends MockScannerStore {
constructor() {
super();
process.env['VX_MACHINE_TYPE'] = 'central-scan';
}
}
export class MockCentralScannerStore extends MockScannerStore {}

/**
* A mock precinct scanner store
Expand All @@ -126,7 +121,6 @@ export class MockPrecinctScannerStore extends MockScannerStore {
super();
this.exportDirectoryName = undefined;
this.pollsState = 'polls_closed_initial';
process.env['VX_MACHINE_TYPE'] = 'scan';
}

getExportDirectoryName(): string | undefined {
Expand Down

0 comments on commit 82fb427

Please sign in to comment.