All files / test/parking/orchestrator parking.ts

100% Statements 14/14
100% Branches 4/4
100% Functions 1/1
100% Lines 14/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151x 1x 1x 1x 1x 1x 4x 1x 1x 1x 1x 1x 1x 1x  
import {handler} from '@feasibleone/blong';
 
export default handler(({lib: {error}}) => {
    const errors = error({'parking.invalidZone': 'Invalid zone'});
    return {
        parkingTest({zone}: {zone: string}) {
            if (!['blue', 'green'].includes(zone)) throw errors['parking.invalidZone']();
            return {
                zone,
                price: {blue: 2, green: 1}[zone],
            };
        },
    };
});