0.0.2 • Published 5 years ago

generalcorecomponents v0.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

General Core COmponents

Publish

Publish the package with release-it:

npm run-script release_it

Tests

There are two ways to run tests:

  1. Locally so that tests are run against local db etc
  2. In Docker when db etc. are created temporary by docker-compose

1. Running locally

Remove all compiled files and install all npm packages:

npm test

Don't remove old files and don't install npm packages:

npm run-script test_fast

Add onlyFdescribe environment value with value true to leave out basicCrudTests that are not fdescribe

onlyFdescribe=true npm run-script test_fast

2. Running in Docker

To run tests in Docker both Docker and docker-compose need to be installed.

Building

docker build . -t generalbackend

Running

docker-compose up --exit-code-from generalback

Environment values

The needed environment variables for tests:

VariableServiceInfo
TEST_ENVIRONMENTMust be 1 to run tests. Outside of test ignored.
general_core_test_postgres_dbPostGresThe database name
general_core_test_postgres_usernamePostGresThe host / server
general_core_test_postgres_passwordPostGresThe username for login
general_core_test_postgres_hostPostGresThe password for login
general_core_test_postgres_portPostGresThe port for connection
general_core_test_mongo_dbMongoThe database name
general_core_test_mongo_usernameMongoThe host / server
general_core_test_mongo_passwordMongoThe username for login
general_core_test_mongo_hostMongoThe password for login
general_core_test_mongo_portMongoThe port for connection
general_core_test_redis_hostRedisThe host for Redis connection
general_core_test_redis_portRedisThe port for Redis connection