mardi 30 janvier 2018

How to test the function that a controller action calls

I have an action that calls another function, within that function I use regex with javascript's string replace. I am running into the issue of testing regex-replace part of it. I keep getting "Cannot read property ‘replace’ of undefined" when I am running my test case. Here is my example:

actions:{
someAction(){
someFunction();}
},
someFunction(){
url = url.replace(/\/$/, '');}




Aucun commentaire:

Enregistrer un commentaire