question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript tests in subfolder of routes are not executed

See original GitHub issue

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

3.27.1

Plugin version

2.15.0

Node.js version

14.18.2

Operating system

Linux

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

20.04

Description

If you move app/test/routes/example.test.ts to app/test/routes/subfolder/example.test.ts, it is not longer executed when running npm run test. This can be fixed by changing tap --ts test/**/*.test.ts to tap --ts test/plugins test/routes.

Steps to Reproduce

Generate an app using npx fastify-cli generate app --lang=ts. Run npm run test. Observe that 3 tests are executed. image

Create a folder subfolder inside app/test/routes. Move app/test/routes/example.test.ts to app/test/routes/subfolder/example.test.ts. Run npm run test. Observe that only 2 tests are executed. image

Expected Behavior

Moving tests to subfolders should not prevent their execution.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
braekeveltcommented, Feb 5, 2022

@KXLAA you can make the Pull Request if you want to. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tests are failing when in subdirectory - Stack Overflow
I am having some issues with Angular2 + TypeScript tests while trying to run them using Karma. This is my Scenario:.
Read more >
Cypress - TypeScript Deep Dive - Gitbook
Feel free to create tests under subfolders for better organization e.g. ... You can run cypress tests in ci mode using the following...
Read more >
Relative fs.readFileSync paths with Node.js - Ultimate Courses
Relative paths will be resolved relative to the current working directory as determined by calling process.cwd() . I was recently coding a Node....
Read more >
Configuring project structure | WebStorm Documentation
Tests Tests folder folders let you keep code related to testing separately from production code. Resource Root Resources root folders: files ...
Read more >
Dealing with files - Learn web development | MDN
File paths · Copy the image you chose earlier into your images folder. · Open up your index. · The line <img src=""...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found