[Vuejs]-Vuejs testing โ€“ Ava โ€“ Changing propData

0๐Ÿ‘

I would use petrol to test vue js components https://github.com/MGMonge/petrol

in that case your test would be

import AnimateNumber from './../src/components/AnimateNumber.vue';
import VueTestCase from "petrol/core/VueTestCase.js";

export default class AnimateNumberTest extends VueTestCase {

    /** @test */
    it_display_the_correct_number() {
        this.SUT = this.mount(AnimateNumber, {number: 2});

        this.assertEquals(2, this.SUT.displayNumber);

        this.SUT = this.mount(AnimateNumber, {number: 5});

        this.assertEquals(5, this.SUT.displayNumber);
    }
}

Leave a comment