As far as I know, you can simply destructure the 'expect' function from the callback parameter object inside 'it', in order to make it work with asynchronous code. Something like this: it('should expect asynchronously', ({ expect }) => {api.getTags().subscribe((response) => { expect(response).toBeTruthy(); })}) But maybe this is just working with vitest, don't know for sure. Anyways, thanks for the content!
Yes. The only difference is that standalone components are not there yet but it doesn't change anything. You inject a component in the test in another way. This is it.
I followed this video till minute 21 and I am stuck. I have this error when running the test: ({"Object.":function(module,exports,require,__dirname,__filename,jest){import { range } from './utils'; ^^^^^^ SyntaxError: Cannot use import statement outside a module at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1505:14) Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0 total Time: 0.916 s Ran all test suites. I can't fix it. can you help me please?
Are you sure you have not nested the import-Statement somewhere? Did you correctly place the import in the beforeEach function? Any syntax errors or anything else like that?
Awesome! This comes to the right time :) Please keep up the great content.
Thank you so much for your support. It means a lot to me!
This is definitely the BEST course on Angular Testing. I also bought your full course.
Thank you, keep up the good work!
Glad you enjoy it!
What I enjoy about your videos is how practical they are. They have immediate use in most large-scale Angular apps. Thank you for your work.
Glad you like them!
I really like your channel!! English is very clear and pleasant to my ear, the material is served very well!
Thank you! 😃
As far as I know, you can simply destructure the 'expect' function from the callback parameter object inside 'it', in order to make it work with asynchronous code. Something like this:
it('should expect asynchronously', ({ expect }) => {api.getTags().subscribe((response) => { expect(response).toBeTruthy(); })})
But maybe this is just working with vitest, don't know for sure. Anyways, thanks for the content!
Sure there are multiple variants to do that
Very well explained in just an hour i went from zero to being confident, however could you also suggest how to unit test the components?
I cover everything about components testing including real project testing in the full course
It lacks the link to github with this code...
It's a part of the paid course. You get access to the code under every single video inside a full course
@@MonsterlessonsAcademy Oh, I see. Thank you ☺️
Awesome course, thank you
Glad you like it!
Woww!! I learned so much thank you
Glad it was helpful!
Would this work with Angular 14?
Yes. The only difference is that standalone components are not there yet but it doesn't change anything. You inject a component in the test in another way. This is it.
You're a great presenter. Keep doing what you do!@@MonsterlessonsAcademy
I followed this video till minute 21 and I am stuck. I have this error when running the test: ({"Object.":function(module,exports,require,__dirname,__filename,jest){import { range } from './utils';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1505:14)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.916 s
Ran all test suites. I can't fix it. can you help me please?
Unfortunately I can't help without debugging your code.
Are you sure you have not nested the import-Statement somewhere? Did you correctly place the import in the beforeEach function? Any syntax errors or anything else like that?
same error
Please upload for react too and next js.
I want also for react.
you too comment maybe he will read yours he havent replied to mine comment
Thank you. I will add it in the list of ideas for the next course
thanks a lot sir @@MonsterlessonsAcademy
For react will be useful also
I will add it to the list of future courses
@@MonsterlessonsAcademy a lot of thanks
thanks
Welcome
35:00
where is the source code?
As this is a part of the full course you get access to the course code of each video inside the course.