fastify / fastify/fastify-cli

Generated Fastify ESM/TS app has broken `npm test` command (FASTIFY_AUTOLOAD_TYPESCRIPT)

Open
#835 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
733
Forks
177
Avg merge
1d 20h
Merged PRs (30d)
3

Description

### Prerequisites

- [x] I have written a descriptive issue title
- [x] I have searched existing issues to ensure the bug has not already been reported

### Fastify version

7.4.0

### Plugin version

_No response_

### Node.js version

24.4.0

### Operating system

Windows

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

11

### Description

Setup
```
fastify generate fastify-test --lang=ts --esm
cd fastify-test
npm install
```

Attempt
```
npm test
```

Outcome
```
> fastify-test@1.0.0 test
> npm run build:ts && tsc -p test/tsconfig.json && FASTIFY_AUTOLOAD_TYPESCRIPT=1 node --test --experimental-test-coverage --loader ts-node/esm test/**/*.ts

> fastify-test@1.0.0 build:ts
> tsc

'FASTIFY_AUTOLOAD_TYPESCRIPT' is not recognized as an internal or external command,
operable program or batch file.
```

### Link to code that reproduces the bug

see above

### Expected Behavior

`npm test` should successfully run as generated.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.