These are chat archives for canjs/canjs

Mar 2018
Ranjan Subbiah
Mar 06 2018 16:45

hey all, I'm using can-fixture ike this:

let randoProgress = chance.pickone(['exploration', 'design', 'construction', 'lighting', 'expansion']);
let stagesResponse = {
    stages: {
        progress: randoProgress
    success: 1

Fixture('GET /json/internet/get_town_stages', function() {
    return stagesResponse;

And then I do some testing. But at some point I need to modify stagesReponse and test. What's the best way to do this?

Kevin Phillips
Mar 06 2018 17:06
can't you just modify it?
is there some reason that won't work? or are you just wondering if that's the best approach?
Ranjan Subbiah
Mar 06 2018 17:10
yeah, tried that and it was throwing an error, but I am realizing it might have more to do with chai as promised.
but also, yeah, is it the best way? Or should I be using Was curious as to how to mock fail response.
Kevin Phillips
Mar 06 2018 18:27
I think either way is fine has some examples of how to mock failures