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.

Entity Profile

Dependency Diagram

graph LR
  4521e1fe_aba9_22b2_c8e7_7e548270f328["methods.spec.ts"]
  4ef3cec1_7e9c_23bb_5e9b_f118e8ebdf99["test-object-option.ts"]
  4521e1fe_aba9_22b2_c8e7_7e548270f328 --> 4ef3cec1_7e9c_23bb_5e9b_f118e8ebdf99
  830d85be_ea2f_f50c_75f1_dd6812fb608f["testObjectOption"]
  4521e1fe_aba9_22b2_c8e7_7e548270f328 --> 830d85be_ea2f_f50c_75f1_dd6812fb608f
  c5601857_7faf_30c6_efca_20de90db006c["vue"]
  4521e1fe_aba9_22b2_c8e7_7e548270f328 --> c5601857_7faf_30c6_efca_20de90db006c
  style 4521e1fe_aba9_22b2_c8e7_7e548270f328 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 CompilerSFC 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: CompilerSFC, 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