Closed fizdalf closed 4 years ago
Hi @fizdalf !
Thanks for the report
Few things -
karma-
in your require
statement as described hereTry adding require('@hirez_io/karma-jasmine-given')
to the array instead.
You didn't write it in the tests, so pay attention that you also need to add @hirez_io/jasmine-given' to the
frameworksarray in
karma.conf.js(this time without the
karma-` keyword)
Lastly, as written here, if your tsconfig.json
has a typesRoots
property, you need to add node_modules/@hirez_io
to it as well...
let me know if that worked for ya
Thanks!
I just saw I had to add require('@hirez_io/karma-jasmine-given'), and not require('@hirez_io/jasmine-given') to the karma plugins array. 🤦 I promise a llama forced me to do it that way.
I believe you! those llamas can be intimidating sometimes... 🦙🤛😅
Describe the bug When adding jasmine-given to the karma.conf.js file console complains about: ERROR [config]: Error in config file! ReferenceError: beforeEach is not defined at E:\learning material\Angular Testing Basics Course\angular-testing1-llama-date\node_modules\@hirez_io\jasmine-given\temp-src\jasmine-given.ts:30:1
I'm following along with the Angular Testing Basics course and I can't move past this. It seems to me that jasmine-given is loading before jasmine is there and thus beforeEach doesn't exist at that point.
This also happens in a brand new Angular project. So I'll use that to illustrate the steps
To Reproduce Steps to reproduce the behavior:
Expected behavior I would expect to run ng test and for it to just work
Attached the brand new Angular project with jasmine-given ..and not working. hirezTest.zip