1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-02 02:36:24 -07:00

Add Jest for JavaScript testing

This commit is contained in:
Eggbertx 2022-01-27 23:26:30 -08:00
parent 1be572dc40
commit 8b92872677
8 changed files with 8331 additions and 36 deletions

19
frontend/README.md Normal file
View file

@ -0,0 +1,19 @@
# gochan.js development
## Building
You can technically use the npm build script directly for building gochan.js, but it's more convenient to just run `./build.py js` from the gochan repo root directory.
If you want to build it without minification, run `./build.py js --nominify`. If you want to have it watch the JS files for changes and rebuild them when you make any in realtime, use the `--watch` flag.
To install your gochan.js after building it, run `./build.py install --js`.
## Testing
Gochan unit testing with [Jest](https://jestjs.io) is still in its early stages and can be run by calling `npm run test` from the frontend directory.
Depending on your npm version, you may need to run this if you get an error saying something like "Missing required argument #1" when you run `npm install` if you have the most up to date npm version available in your distro's repo.
```
sudo npm install -g n
sudo n latest
sudo npm install -g npm
npm install
```