Mac Developers: Install Xcode command line tools if you don't already have them.
Windows Developers: Install Node.js globally, may also have to run Spearmint in admin mode.
- Download VcXsrv or a similar program in order to run an X environment on Windows. VcXsrv
- Configure XLaunch properly:
- On the first settings screen on launch, select the following settings:
- Multiple windows
- Display number: -1
- On the second page select the “Start no client” option
- On the third setting screen select the following options:
- Clipboard
- Primary Selection
- Native opengl
- Under “Additional Parameters” textbox write ‘-ac’ (no quotes)
Completing these steps after installing will launch XLaunch and enable you to run Spearmint in the Windows desktop environment.
As of January 2023, spearmint works with node version 20.1.0. React must be version 17 due to a dependency for mui. Fix-path must be version 3.0.0 due to 4.0.0 only being usable with an import statement, which is not supported in electron.jsx.
-
Fork and clone this repository.
-
npm install
-
Create a .env file in the root directory of the project
-
Insert the following lines of code into the .env file
APP_DEV=true BROWSER=non SKIP_PREFLIGHT_CHECK=true MONGO_LINK=mongodb+srv://username:[email protected]/?retryWrites=true&w=majority
-
Set MONGO_LINK to your MongoDB URI or use the URI we provided (ex: mongodb://localhost:27017)
-
Make sure your MongoDB is running if it's hosted locally.
-
npm run rebuild
(different fromnpm rebuild
so please pay attention to that) -
npm run dev
-
To enable hot-module reloading, uncomment line 22 in the electron.jsx file.
// require('electron-reloader')(module);
-
To enable Chrome Dev Tools, uncomment line 70 in the electron.jsx file:
// mainWindow.webContents.openDevTools();
-
Exporting test files in TypeScript: the tests currently export in JS.
-
Convert codebase to TypeScript: currently, there are some files in TS, and others in JS. It would be great to convert all to TS.
-
Dry refactoring of codebase: A lot of the folders and files for the frontend frameworks testing are the same, and the codebase would GREATLY benefit from refactoring and modularizing those.
-
Persist user data: there is currently sign up and login functionality. V0.13.0 commented out the login functionality because there is currently no user data being persisted. A great feature would be to save tests to work on them later, or create templates for each user.
-
GitHub OAuth is functional, but Google OAuth is currently broken. If you are planning to persist user data, this is an excellent feature to resolve.
-
Add more customization to the tests themselves such as chaining expects, add the ability to use siblings and children, etc., or having the ability to test more than one component in one test file.
-
Some of test cases needs improvement on UI as they do not have any styling or optimal user experience
-
Continue to improve internal testing coverage – while it has been greatly expanded there are many parts of the internals of the application that are still not being tested, and especially with regards to integration and end to end testing, more could be done.
-
Consider removing MUI framework as it is incompatible with React v18+ and no longer being actively updated - either replacing with another frontend framework or styling via CSS.
-
Consider implementing React Dev Tools in the app.
Please feel free to add any other features or fixes that you would like or are interested in.
-
Mongo: Mongodb is used for authentication functionality. If you didn't use locally hosted mongodb URI in .env file, you may skip to the X server section.
-
Add
172.17.0.1
and0.0.0.0
to the network interfaces of mongo config file.a. Open
mongod.cfg
(Usually located in C:\Program Files\MongoDB\Server\4.4\bin)# network interfaces net: port: 27017 bindIp: 127.0.0.1, 172.17.0.1, 0.0.0.0
-
Run mongo on port 27017
-
-
X server
After running the mongo on port 27017 and running the x server with display number of 0, follow the steps below.
-
Build the docker image by running the following command
docker build -t [image name] .
-
Run the docker image by using the following command:
`docker run -e DISPLAY='host.docker.internal:0.0' -it -v [directory of project to be tested]:/[directory to create volume] [image name]` - `-e DISPLAY='host.docker.internal:0.0'`: Set environment variable ‘display’ to host.docker.internal:0.0 - `-it`: Run container as interactive - `-v`: Creates a volume and mounts the testing application into the container. (ex: `-v [testing files]:[created volume]`) *Please note that once the spearmint container is running, you can only access the folders that you mounted here.`
Please note that the image uses root user, as shown in the Dockerfile.