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

parent.spec.ts — vue Source File

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

File typescript 1 imports

Entity Profile

Dependency Diagram

graph LR
  e42de315_452a_449e_4a7c_f15937362de9["parent.spec.ts"]
  c5601857_7faf_30c6_efca_20de90db006c["vue"]
  e42de315_452a_449e_4a7c_f15937362de9 --> c5601857_7faf_30c6_efca_20de90db006c
  style e42de315_452a_449e_4a7c_f15937362de9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import Vue from 'vue'

describe('Options parent', () => {
  it('should work', () => {
    const parent = new Vue({
      render() {}
    }).$mount()

    const child = new Vue({
      parent: parent,
      render() {}
    }).$mount()

    // this option is straight-forward
    // it should register 'parent' as a $parent for 'child'
    // and push 'child' to $children array on 'parent'
    expect(child.$options.parent).toBeDefined()
    expect(child.$options.parent).toEqual(parent)
    expect(child.$parent).toBeDefined()
    expect(child.$parent).toEqual(parent)
    expect(parent.$children).toContain(child)

    // destroy 'child' and check if it was removed from 'parent' $children
    child.$destroy()
    expect(parent.$children.length).toEqual(0)
    parent.$destroy()
  })
})

Dependencies

  • vue

Frequently Asked Questions

What does parent.spec.ts do?
parent.spec.ts is a source file in the vue codebase, written in typescript.
What does parent.spec.ts depend on?
parent.spec.ts imports 1 module(s): vue.
Where is parent.spec.ts in the architecture?
parent.spec.ts is located at test/unit/features/options/parent.spec.ts (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