cli/directives/TestDirective.js

/**
 * @module flitter-cli/directives/TestDirective
 */

const Directive = require('../Directive')

/**
 * Directive that simply checks if Flitter can launch properly.
 * 
 * @extends module:flitter-cli/Directive~Directive
 */
class TestDirective extends Directive {

    /**
     * Get the name of the directive. Used by ./flitter.
     * @returns {string} "test"
     */
    static name(){
        return "test"
    }

    /**
     * Get the usage information for the unit. Used by ./flitter help.
     * @returns {string}
     */
    static help(){
        return "check to see if Flitter can launch"
    }

    /**
     * Handle an invocation of this unit. Prints a success message.
     * @param {module:libflitter/app/FlitterApp~FlitterApp} app - the Flitter app
     * @param {Array} argv - array of CLI arguments passed to the unit
     * @returns {Promise<void>}
     */
    async handle(app, argv){
        this.success('Flitter launched successfully. That doesn\'t mean that all of your app logic works, just that the framework backend initialized properly.')
    }
    
}

module.exports = exports = TestDirective