How to use @hapi/vision - 2 common examples

To help you get started, we’ve selected a few @hapi/vision examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github academia-de-codigo / noire-server / test / plugins / docs.js View on Github external
it('handles vision plugin registration failures', async flags => {
        // cleanup
        const visionRegister = Vision.plugin.register;
        flags.onCleanup = function() {
            Vision.plugin.register = visionRegister;
        };

        // setup
        const PLUGIN_ERROR = 'plugin error';
        Vision.plugin.register = async function() {
            throw new Error(PLUGIN_ERROR);
        };
        const server = Hapi.server();

        // exercise and validate
        await expect(server.register(Docs)).to.reject(PLUGIN_ERROR);
    });
github academia-de-codigo / noire-server / test / plugins / docs.js View on Github external
flags.onCleanup = function() {
            Vision.plugin.register = visionRegister;
        };

@hapi/vision

Templates rendering plugin support for hapi.js

BSD-3-Clause
Latest version published 1 year ago

Package Health Score

63 / 100
Full package analysis

Popular @hapi/vision functions