All files / test/framework/demo/gateway/test.dev test.demo.add.ts

69.56% Statements 16/23
100% Branches 0/0
100% Functions 0/0
69.56% Lines 16/23

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 15 16 17 18 19 20 21 22 23 241x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x               1x  
import {validation} from '@feasibleone/blong';
 
/**
 * Demo of the `.dev`-group convention: a gateway validation placed in a
 * handler-group folder ending in `.dev` (here `gateway/test.dev/`) is loaded
 * only under the `dev` intent. Under any other intent the folder is skipped, so
 * the `test.demo.add` route does not exist.
 *
 * Note: this must be a `.dev`-suffixed handler group folder. Putting the file in
 * a plain `gateway/test/` folder does NOT make it dev-only — `test` there is a
 * regular handler group inside the `gateway` layer and loads whenever the layer
 * loads.
 */
export default validation(
    async ({lib: {type}}) =>
        function testDemoAdd() {
            return {
                auth: false,
                params: type.Any(),
                result: type.Any(),
            };
        },
);