Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing #80

Open
Feargh opened this issue Jun 25, 2024 · 2 comments
Open

Testing #80

Feargh opened this issue Jun 25, 2024 · 2 comments
Assignees

Comments

@Feargh
Copy link
Contributor

Feargh commented Jun 25, 2024

Add testing. Look into using jest.

@Feargh Feargh self-assigned this Jun 25, 2024
Feargh added a commit that referenced this issue Jun 25, 2024
@Feargh
Copy link
Contributor Author

Feargh commented Jun 25, 2024

Feargh added a commit that referenced this issue Jun 25, 2024
Feargh added a commit that referenced this issue Jun 25, 2024
Feargh added a commit that referenced this issue Jun 25, 2024
Feargh added a commit that referenced this issue Jun 25, 2024
Feargh added a commit that referenced this issue Jun 25, 2024
Feargh added a commit that referenced this issue Jun 27, 2024
@Feargh
Copy link
Contributor Author

Feargh commented Jun 27, 2024

https://stackoverflow.com/questions/72128718/test-suite-failed-to-run-import-meta-env-vite

I tried this from this link:

After much research, I was able to solve the case.

I had to install the vite-plugin-environment and babel-plugin-transform-import-meta libraries and make the following settings:

babel.config.js

module.exports = {
...
plugins: ["babel-plugin-transform-import-meta"]
}

tsonfig.json

{
...
"compilerOptions": {
"module": "esnext",
...
"types": [
"node"
]
},
...
}

vite.config.ts

...
import EnvironmentPlugin from "vite-plugin-environment"
...
export default defineConfig({
plugins: [..., EnvironmentPlugin("all")],
...
})

Also change the import.meta.env.* to process.env.*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant