fastify / fastify-cli

Run a Fastify application with one command!
MIT License
657 stars 163 forks source link

generated build function for test setup doesn't load/autoload plugins #628

Open cherifGsoul opened 1 year ago

cherifGsoul commented 1 year ago

Prerequisites

Last working version

4.x

Stopped working in version

5.7.1

Node.js version

v18.16.0

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

Ubuntu 22.04.2 LTS

💥 Regression Report

Generated app, in the test build function, I believe const app = await helper.build(argv, await config()) doesn't load/autoload plugins, Am I missing something? The issue is about the following line https://github.com/fastify/fastify-cli/blob/f111b25b96d9f29d42c9a8f5ced4108f56a073d0/templates/app-ts/test/helper.ts#L24 app.register app.ready work perfectly before.

In my case, I needed this in the test setup to use the ORM fastify plugin I'm using to generate db schema and remove in teardown.

Steps to Reproduce

Expected Behavior

The plugin function results should be returned.