Skip to content

vitest tsconfig path failed to load url in node js (express) #5455

Answered by darylescode
darylescode asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you so much! I just checked your project and aligned the structure with yours. What fixed it was moving the tsconfig.json file to the root folder and then adding include": ["./src","../vitest.config.ts"] to it then it works.

May I ask how to exclude the files following role-based naming convention such auth.route.ts like in the below :

vitest.config.ts
it doesn't exclude the files I don't want to be included

/// <reference types="vitest" />
import path                from "path";
import { UserConfig } from "vitest";

export default import("vitest/config").then(({ defineConfig, configDefaults }) => {
  return defineConfig({
    resolve: {
      alias: [
        {
          find: /^@…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@darylescode
Comment options

@ygqygq2
Comment options

@darylescode
Comment options

Answer selected by darylescode
@ygqygq2
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants