UNPKG

ncsbe-lib

Version:

JavaScript library for working with North Carolina State Board of Elections (NCSBE) historical election data

95 lines (92 loc) 2.6 kB
import { ContestData } from '../types'; export const mockElectionData = [ { contestName: 'US_PRESIDENT', counties: [ { county: 'Orange', precincts: [ { precinct: '1', candidates: [ { candidate: 'John', party: 'DEM', votes: 100050, }, { candidate: 'Mark', party: 'REP', votes: 100000, }, { candidate: 'Alex', party: 'DEM', votes: 1000, }, ], }, ], }, ], candidates: [ { candidate: 'John', party: 'DEM', votes: 100050, }, { candidate: 'Mark', party: 'REP', votes: 100000, }, { candidate: 'Alex', party: 'DEM', votes: 1000, }, ], }, { contestName: 'US_SENATE', counties: [ { county: 'Wake', precincts: [ { precinct: '2', candidates: [ { candidate: 'Alex', party: 'DEM', votes: 15000, }, { candidate: 'Felix', party: 'REP', votes: 18000, }, ], }, ], }, ], candidates: [ { candidate: 'Alex', party: 'DEM', votes: 15000, }, { candidate: 'Felix', party: 'REP', votes: 18000, }, ], }, ]; export class Collector { async collect(): Promise<ContestData[]> { return Promise.resolve(mockElectionData); } }