2
0

methods.spec.js 290 B

123456789101112131415161718
  1. import Vue from 'vue'
  2. describe('Options methods', () => {
  3. it('should have correct context', () => {
  4. const vm = new Vue({
  5. data: {
  6. a: 1
  7. },
  8. methods: {
  9. plus () {
  10. this.a++
  11. }
  12. }
  13. })
  14. vm.plus()
  15. expect(vm.a).toBe(2)
  16. })
  17. })