angularjs - $httpBacked, Error: Unsatisfied requests for regexed when statement -
var baseurl = 'http://localhost:3481'; before each test adding handler get request
$httpbackend.when('get', new regexp(baseurl + '/reports\\?.*', 'g')) in 1 of it expression, i'm expecting following request
var starttime = moment().subtract(1, 'week'), endtime = moment(), queryparams = "endtime=" + endtime.toisostring() + "&starttime=" + starttime.toisostring(); $httpbackend.expectget(baseurl + '/reports?' + queryparams); but continue error: unsatisfied requests [get] http://localhost:3481/reports?endtime...
i have tried regexp string , reg.test() method returns true http://grab.by/nfhi
tried that
'http://localhost:3481/reports?endtime=2016-01-27t20:41:52.302z&starttime=2016-01-26t20:41:52.302z'.match(new regexp('http://localhost:3481' + '/reports\\?.*', 'g')) , returns ["http://localhost:3481/reports?end..."]
what problem here?
Comments
Post a Comment