Fix: Tests lint and src folder (#138)

* Automaticly fixable eslint issues, mostly 3 -> 2 space indentation

* fix: updated plex_userid to camelcase

* Linted and some consistency refactor on middleware

* eslint uses ecmaversion 2020 & allow empty catch rule

* Started linting source files

* Fixed eslint errors & improved a lot of error handling

* Set 2 eslint rules as warning temporarly

* Updated all import statements to be relative

* Updated mocha & nyc, resolved all lint issues in tests/

* Updated mocha & nyc. Removed production config. Updated gitignore

* Updated test commands to omit system tests, no exit code

* Updated test configuration w/ missing keys

* Chai modules defined in package.json & resolved linting errors

* Dockerfile copies development.example -> production.json. Simplified commands

* All api calls from tests use same chaiHttp implementation

Removes a list of fetch alternatives after being replaced by chaiHttp:
 - request
 - request-promise
 - supertest
 - supertest-as-promised

* Tests should use redis (mock) cache, not tmdb sqlite cache

* Disabled test asADeveloperIWantTheServerToStart

* Re-enable tests/system

* Use chaiHttp in asAUserIWantToRequestAMovie.

* Fixed redis expire & mock implmentation

* Replaced all fetch alternatives from source code and package.json

* Pass error from tmdb api back to client as errorMessage

* Updated authentication middleware to handle checks consitenctly

* Prevent assert error when checking request status, returns success 200

* Resolved merge conflicts

* Only build and publish docker container when branch master
This commit is contained in:
2022-08-20 17:41:46 +02:00
committed by GitHub
parent 1815a429b0
commit 628ed52012
44 changed files with 1248 additions and 1592 deletions

View File

@@ -1,31 +0,0 @@
{
"database": {
"host": "/Users/kevin/dev/seasonedShows/shows.db"
},
"webserver": {
"port": 31459,
"origins": ["https://kevinmidboe.com", "https://seasoned.show", "https://request.movie"]
},
"tmdb": {
"apiKey": "9fa154f5355c37a1b9b57ac06e7d6712"
},
"plex": {
"ip": "blex.schleppe"
},
"tautulli": {
"apiKey": "4e759f7acabf4f1a8893825e6acd522b",
"ip": "blex.schleppe",
"port": "8181"
},
"raven": {
"DSN": ""
},
"authentication": {
"secret": "secret"
},
"sms": {
"apikey": "qK48YChORZOX4FqAwgzdOrfYT2-bixwshtRe-BogNksBZyUrMHLTh0-XOjsxziPV",
"sender": "Seasoned",
"recipient": 41498549
}
}

View File

@@ -2,19 +2,30 @@
"database": {
"host": ":memory:"
},
"redis": {
"host": "localhost",
"port": 6379
},
"webserver": {
"port": 31400
"port": 31400,
"origins": []
},
"tmdb": {
"apiKey": "bogus-api-key"
},
"plex": {
"ip": "0.0.0.0"
"ip": "localhost",
"token": ""
},
"tautulli": {
"apiKey": "",
"ip": "",
"port": ""
},
"raven": {
"DSN": ""
},
"authentication": {
"secret": "secret"
}
"secret": "secret"
}
}