This is a small sample for using Angular's fakeAsync test helper in a nest.js application.
Most of the code was autogenerated by the awesome nest cli. There are two main files of interest: spec/test.spec.ts
shows a small working demo of the fakeAsync
function in action. helpers/fakeAsync.ts
contains the actual function definitions. You may also be interested to look at the contents of the package.json
.
I first created a new nestjs service with
nest new fake-async
Then I installed the necessary dependencies.
npm install --save-dev zone.js @types/zone.js
I then installed and set up jasmine
npm install --save-dev jasmine @types/jasmine
Then I created fakeAsync.ts
. Of import: the right import
statements at the top.