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

properties.spec.ts — vue Source File

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

File typescript 1 imports

Entity Profile

Dependency Diagram

graph LR
  2df09534_c339_b47e_ed49_a1a437435de6["properties.spec.ts"]
  db9e7bef_009d_3918_6e7d_543a36a38d75["vue"]
  2df09534_c339_b47e_ed49_a1a437435de6 --> db9e7bef_009d_3918_6e7d_543a36a38d75
  style 2df09534_c339_b47e_ed49_a1a437435de6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import Vue from 'vue'

describe('Instance properties', () => {
  it('$data', () => {
    const data = { a: 1 }
    const vm = new Vue({
      data
    })
    expect(vm.a).toBe(1)
    expect(vm.$data).toBe(data)
    // vm -> data
    vm.a = 2
    expect(data.a).toBe(2)
    // data -> vm
    data.a = 3
    expect(vm.a).toBe(3)
  })

  it('$options', () => {
    const A = Vue.extend({
      methods: {
        a() {}
      }
    })
    const vm = new A({
      methods: {
        b() {}
      }
    })
    expect(typeof vm.$options.methods?.a).toBe('function')
    expect(typeof vm.$options.methods?.b).toBe('function')
  })

  it('$root/$children', done => {
    const vm = new Vue({
      template: '<div><test v-if="ok"></test></div>',
      data: { ok: true },
      components: {
        test: {
          template: '<div></div>'
        }
      }
    }).$mount()
    expect(vm.$root).toBe(vm)
    expect(vm.$children.length).toBe(1)
    expect(vm.$children[0].$root).toBe(vm)
    vm.ok = false
    waitForUpdate(() => {
      expect(vm.$children.length).toBe(0)
      vm.ok = true
    })
      .then(() => {
        expect(vm.$children.length).toBe(1)
        expect(vm.$children[0].$root).toBe(vm)
      })
      .then(done)
  })

  it('$parent', () => {
    const calls: any[] = []
// ... (154 more lines)

Dependencies

  • vue

Frequently Asked Questions

What does properties.spec.ts do?
properties.spec.ts is a source file in the vue codebase, written in typescript.
What does properties.spec.ts depend on?
properties.spec.ts imports 1 module(s): vue.
Where is properties.spec.ts in the architecture?
properties.spec.ts is located at test/unit/features/instance/properties.spec.ts (directory: test/unit/features/instance).

Analyze Your Own Codebase

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

Try Supermodel Free