Home / File/ methods.spec.ts — vue Source File

methods.spec.ts — vue Source File

Architecture documentation for methods.spec.ts, a typescript file in the vue codebase. 3 imports, 0 dependents.

File typescript VueCore 3 imports

Entity Profile

Dependency Diagram

graph LR
  ef64c188_5d10_cf00_2e9f_ea00957fb198["methods.spec.ts"]
  09b3d58b_2586_2d23_1760_3ec3fe090d46["test-object-option.ts"]
  ef64c188_5d10_cf00_2e9f_ea00957fb198 --> 09b3d58b_2586_2d23_1760_3ec3fe090d46
  4a7600ac_90db_8739_d900_439c1c18fef7["testObjectOption"]
  ef64c188_5d10_cf00_2e9f_ea00957fb198 --> 4a7600ac_90db_8739_d900_439c1c18fef7
  db9e7bef_009d_3918_6e7d_543a36a38d75["vue"]
  ef64c188_5d10_cf00_2e9f_ea00957fb198 --> db9e7bef_009d_3918_6e7d_543a36a38d75
  style ef64c188_5d10_cf00_2e9f_ea00957fb198 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import Vue from 'vue'
import testObjectOption from '../../../helpers/test-object-option'

describe('Options methods', () => {
  testObjectOption('methods')

  it('should have correct context', () => {
    const vm = new Vue({
      data: {
        a: 1
      },
      methods: {
        plus() {
          this.a++
        }
      }
    })
    vm.plus()
    expect(vm.a).toBe(2)
  })

  it('should warn methods of not function type', () => {
    new Vue({
      methods: {
        hello: {}
      }
    })
    expect(
      'Method "hello" has type "object" in the component definition'
    ).toHaveBeenWarned()
  })

  it('should warn methods conflicting with data', () => {
    new Vue({
      data: {
        foo: 1
      },
      methods: {
        foo() {}
      }
    })
    expect(
      `Method "foo" has already been defined as a data property`
    ).toHaveBeenWarned()
  })

  it('should warn methods conflicting with internal methods', () => {
    new Vue({
      methods: {
        _update() {}
      }
    })
    expect(
      `Method "_update" conflicts with an existing Vue instance method`
    ).toHaveBeenWarned()
  })
})

Domain

Frequently Asked Questions

What does methods.spec.ts do?
methods.spec.ts is a source file in the vue codebase, written in typescript. It belongs to the VueCore domain.
What does methods.spec.ts depend on?
methods.spec.ts imports 3 module(s): test-object-option.ts, testObjectOption, vue.
Where is methods.spec.ts in the architecture?
methods.spec.ts is located at test/unit/features/options/methods.spec.ts (domain: VueCore, directory: test/unit/features/options).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free