github.com/ethereum-optimism/optimism@v1.7.2/packages/common-ts/test/service-spec.ts (about) 1 import { validators } from '../dist' 2 import { BaseServiceV2 } from '../src' 3 4 type ServiceOptions = { 5 camelCase: string 6 } 7 8 class Service extends BaseServiceV2<ServiceOptions, {}, {}> { 9 constructor(options?: Partial<ServiceOptions>) { 10 super({ 11 name: 'test-service', 12 version: '0.0', 13 options, 14 optionsSpec: { 15 camelCase: { validator: validators.str, desc: 'test' }, 16 }, 17 metricsSpec: {}, 18 }) 19 } 20 protected async main() { 21 /* eslint-disable @typescript-eslint/no-empty-function */ 22 } 23 } 24 25 describe('BaseServiceV2', () => { 26 it('base service ctor does not throw on camel case options', async () => { 27 new Service({ camelCase: 'test' }) 28 }) 29 })