I am working on writing unit test using karma, jasmine, mocha etc. I am having one module imported in application which have jQuery as dependency but I am getting error while running test case i.e
ReferenceError: $ is not defined
I have added jQuery reference in angular.json as .
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"styles": [],
"scripts": [
"node_modules/jquery/dist/jquery.min.js"
],
"assets": [
//Assers
]
}
I also tried adding jQuery reference in tsconfig.spec.json as
"files": [
"../../node_modules/jquery/dist/jquery.min.js",
"src/test.ts",
"src/polyfills.ts"
],
Comments
Post a Comment