Skip to content

start() is not exported on instanceΒ #113

@jmealo

Description

@jmealo

πŸ› Bug Report

.start() is not exported on instance, however, .ready() is.

To Reproduce

Steps to reproduce the behavior:

const app = {};

const avvioOptions = {
    expose: {
        use: 'load'
    }
};

require('avvio')(app, avvioOptions);

console.log(app.load === undefined); // false
console.log(app.ready === undefined); // false

console.log(app.start === undefined); // true

Expected behavior

I expect that start is exported either automatically or via the expose configuration option in boot.js at line 18: startKey = expose.start || 'start'

const app = {};

const avvioOptions = {
    expose: {
        use: 'load'
    }
};

require('avvio')(app, avvioOptions);

console.log(app.load === undefined); // false
console.log(app.ready === undefined); // false
console.log(app.start === undefined); // false

// --------- and/or ------ 

const app = {};

const avvioOptions = {
    expose: {
        start: 'blastOff'
    }
};

require('avvio')(app, avvioOptions);

console.log(app.blastOff === undefined); // false

Your Environment

  • node version: 12
  • fastify version: N/A avvio = 7.0.3
  • os: Mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions