Hentai Library Thingy
Go to file
Xymorot b72e608280 doc: add comment to uuid function 2019-11-20 23:21:32 +01:00
declarations test: add test framework (spectron + mocha), combined with refactoring of the directory structures 2019-11-20 23:21:24 +01:00
resources feat: add icon/logo 2019-07-26 22:18:56 +02:00
src doc: add comment to uuid function 2019-11-20 23:21:32 +01:00
tests test: increase timeout for application test 2019-11-20 23:21:31 +01:00
.editorconfig install tslint and prettier with stuff around to make them work together 2019-06-04 22:54:56 +02:00
.eslintignore test: add simple unit test with sinon and nock, also refactor 'test' directory to 'tests', split tests into integration and unit 2019-11-20 23:21:27 +01:00
.eslintrc.json config: add specific tslint file for tests, adjust eslint/tslint to fail on broken rule (error severity) 2019-11-20 23:21:28 +01:00
.gitignore config: add instanbuljs/nyc for code coverage 2019-11-20 23:21:28 +01:00
.mocharc.yml test: remove split between integration and unit tests, use tags instead 2019-11-20 23:21:27 +01:00
.nycrc.yml config: add html coverage reporter and only report summary in console 2019-11-20 23:21:29 +01:00
.prettierrc.yml config: configure quoteProps to consistent in prettier 2019-11-20 23:21:29 +01:00
README.md config: install fast-check for property based testing 2019-11-20 23:21:30 +01:00
forge.config.js config: add instanbuljs/nyc for code coverage 2019-11-20 23:21:28 +01:00
gulpfile.js test: add test framework (spectron + mocha), combined with refactoring of the directory structures 2019-11-20 23:21:24 +01:00
index.dev.html reformat: run prettier 2019-11-20 23:21:24 +01:00
index.prod.html config: implement webpack dev mode by unifying gulp and webpack 2019-11-20 23:21:22 +01:00
ormconfig.yml test: add test framework (spectron + mocha), combined with refactoring of the directory structures 2019-11-20 23:21:24 +01:00
package-lock.json config: install fast-check for property based testing 2019-11-20 23:21:30 +01:00
package.json config: adjust pre-commit script to run prettier and not prettier:write since the written changes are not staged 2019-11-20 23:21:31 +01:00
tsconfig.json config: fix include array to only include relevant directories 2019-11-20 23:21:30 +01:00
tslint.json config: add specific tslint file for tests, adjust eslint/tslint to fail on broken rule (error severity) 2019-11-20 23:21:28 +01:00
webpack.config.js test: add test framework (spectron + mocha), combined with refactoring of the directory structures 2019-11-20 23:21:24 +01:00

README.md

Renai

レンアイ - Hentai Library Thingy

Development

Quickstart

  • npm install, the postinstall runs
    • npm run rebuild
      • might need to install some build tools depending on your platform
  • npm run watch for code transpilation (starts watchers)
  • npm run start

Git Commits

This project uses Conventional Commits with the following types:

  • feat: features, if any part of your commit implements a new functionality or changes an existing one, use this
  • remove: removal of existing code/functionality
  • fix: bugfixes
  • refactor: code refactoring
  • test: any of the above, but with tests
  • update: updating dependencies and associated code changes
  • config: changing configuration (linters, build process)
  • doc: documentation, including comments
  • reformat: fixing code formatting

Always try to split up your changes into coherent commits, a single commit should do a single thing. If your commit needs to do more than one thing it should be labeled with the type coming first in this list.

Database Migrations

Migrations are stored in src/main/migrations and handled by typeorm. Migrations are run on app start inside database.ts.

To auto-generate a migration:
node_modules/.bin/typeorm migration:generate -n <migration name> -c <connection name>

To create an empty creation which can be filled with custom migration code:
node_modules/.bin/typeorm migration:create -n <migration name> -c <connection name>

To run migrations:
node_modules/.bin/typeorm migration:run -c <connection name>
This is also pre-defined in the npm script typeorm:migrate.

Testing

The testing framework of choice is Mocha. Call npm run test to run all tests. Tests are written in typescript and need to be transpiled before testing.

  • assertion is (mainly) done by Chai
  • Electron specific testing is done by Spectron
  • spies, stubs and mocks are provided by Sinon.JS
  • HTTP server mocking is done by nock
  • property based testing is made possible by fast-check

Tagging

Mocha does not have a seperate tagging feature, but it can filter via title. Us the following tags in your test titles:

  • @slow when the test is particularly slow