So today I was awoken to the fact that my database had mysteriously lost data after putting out a new feature. This a MongoDB database whereby, via the driver, you can replace documents. After some digging I found that despite calling a function “updateEmployer” GitHub Co-Pilot had actually written the body of a function called […]
Using this https://bojnansky.com/running-angular-tests-with-github-actions/ as a guide I made GitHub actions for angular testing, I used this action: With the npm command in the link:
A good env: A good env setup: jest.config.js jest-mongodb-config.js A global file for running predictable tests: setup-jest.js I also tend to add some helper components, namely a base record creator like so: BaseFixture.js UserFixture.js So an example unit test making use of these would be:
This is because NACL is used for internal routing as well so you need to add the ephemeral ports, i.e. https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html#nacl-ephemeral-ports most commonly 1024-65535, all AWS services use these ports to communicate
You can do this with response-time plugin but I wanted something a bit more flexible and can easily be used on select routes as middleware, so I made: in my base expressjs route file, now I can easily log certain routes by doing: