stuartrobinson
stuartrobinson
WWasp
Created by nezamy on 7/28/2024 in #đŸ™‹questions
tsconfig paths alias
Ok, thanks for the quick reply
22 replies
WWasp
Created by nezamy on 7/28/2024 in #đŸ™‹questions
tsconfig paths alias
Did this get fixed @sodic ? I can see this post which indicates it was: https://www.linkedin.com/posts/matijasosic_shadcn-support-in-wasp-has-just-become-lemon-activity-7285742549116325888-TEGo/ But I'm still getting the issue when building the SDK
22 replies
TTCTheo's Typesafe Cult
Created by niels on 5/26/2023 in #questions
t3-env issues with Vitest test cases
That’s right
69 replies
TTCTheo's Typesafe Cult
Created by niels on 5/26/2023 in #questions
t3-env issues with Vitest test cases
I couldn't get this to work. Instead I added the following line to defineConfig:
process.env = loadEnv(mode, process.cwd(), '')
process.env = loadEnv(mode, process.cwd(), '')
Full code here:
import { defineConfig } from 'vitest/config'
import { loadEnv } from 'vite'

export default defineConfig(({ mode }) => {
// By default this plugin will only load variables that start with VITE_*
// To fix this we can use the loadEnv function from Vite
// We set the third parameter to '' to load all env regardless of the `VITE_` prefix.
process.env = loadEnv(mode, process.cwd(), '')
return {
test: {
globals: true,
includeSource: ['lib/**/*.{js,ts}', 'utils/**/*.{js,ts}'],
environment: 'happy-dom',
alias: {
'@/': new URL('./', import.meta.url).pathname,
},
},
}
})
import { defineConfig } from 'vitest/config'
import { loadEnv } from 'vite'

export default defineConfig(({ mode }) => {
// By default this plugin will only load variables that start with VITE_*
// To fix this we can use the loadEnv function from Vite
// We set the third parameter to '' to load all env regardless of the `VITE_` prefix.
process.env = loadEnv(mode, process.cwd(), '')
return {
test: {
globals: true,
includeSource: ['lib/**/*.{js,ts}', 'utils/**/*.{js,ts}'],
environment: 'happy-dom',
alias: {
'@/': new URL('./', import.meta.url).pathname,
},
},
}
})
And also specify the mode when running vitest:
vitest --mode development
vitest --mode development
69 replies