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
Add support for vitest testing framework #88
Comments
Testing with You can add a Vite configuration file in root, use the same configuration as renderer(in /// <reference types="vitest" />
import { defineConfig } from "vite";
import { resolve } from 'path';
export default defineConfig({
test: {
// ...
},
build: {
rollupOptions: {
input: {
index: resolve(__dirname, 'src/renderer/index.html')
}
}
}
}); This is a temporary solution, which does not meet the original design intention of In addition, Electron not supports |
Sorry to borther you. But I just don't understand how to specify the entry point.electron.vite.config.*. Won't you set the input.index:resolve(__dirname, 'src/renderer/index.html') in Vite configuration file in the root? where is the place to specify the entry point? |
Support for vitest is still very important |
There's a PR open to support esm modules that seems like it will probably be merged. If I understand all of this correctly, if electron vite gets updated to point at whatever version includes this change, we can get rid of the commonjs transpiling steps and we'll get vitest support for free? |
this doesn't make vite load the |
I made a serious attempt at porting a project from a CRA app but despite many permutations, I was not able to get testing set up. It's hard to understand how this project could be useful in production without robust testing support and I wonder if this is in violation of semver given the lack of prerelease in version. I looked at using I tried using both the renderer property of the return value of electron-vite's defineConfig AND the renderer value passed to the defineConfig in both a |
I am also trying to migrate a project to electron-vite. Whats a good test framework that works well with electron-vite? |
Path aliases do not work with vitest |
I have the same problem... Do we have some new solutions? |
Any help required with this? |
Clear and concise description of the problem
This tool abstracts Electron and Vite configuration beautifully; if it could do the same for a testing framework that would be dream, saving devs some manual work.
Suggested solution
At project creation time add the option to add a testing framework, maybe vitest (https://vitest.dev/).
Alternative
No response
Additional context
I've managed to set up vitest, but with my limited coverage of electron-vite, it was imperfect integration. Struggled with nested
renderer
folder and ended up adding anotherindex.html
file in the project root in order to make all the paths / modules resolve correctly.Additionally had to add
type: module
in package.json for vite to work.Validations
The text was updated successfully, but these errors were encountered: