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

mixins.spec.ts — vue Source File

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

File typescript 2 imports

Entity Profile

Dependency Diagram

graph LR
  591a3baf_5dd7_2b79_41d2_66fe632a750b["mixins.spec.ts"]
  c5601857_7faf_30c6_efca_20de90db006c["vue"]
  591a3baf_5dd7_2b79_41d2_66fe632a750b --> c5601857_7faf_30c6_efca_20de90db006c
  02e43f4a_da65_7acd_5a98_0f017554a159["index"]
  591a3baf_5dd7_2b79_41d2_66fe632a750b --> 02e43f4a_da65_7acd_5a98_0f017554a159
  style 591a3baf_5dd7_2b79_41d2_66fe632a750b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import Vue from 'vue'
import { mergeOptions } from 'core/util/index'

describe('Options mixins', () => {
  it('vm should have options from mixin', () => {
    const mixin = {
      directives: {
        c: {}
      },
      methods: {
        a: function () {}
      }
    }

    const vm = new Vue({
      mixins: [mixin],
      methods: {
        b: function () {}
      }
    })

    expect(vm.a).toBeDefined()
    expect(vm.b).toBeDefined()
    expect(vm.$options.directives.c).toBeDefined()
  })

  it('should call hooks from mixins first', () => {
    const a = {}
    const b = {}
    const c = {}
    const f1 = function () {}
    const f2 = function () {}
    const f3 = function () {}
    const mixinA = {
      a: 1,
      template: 'foo',
      directives: {
        a: a
      },
      created: f1
    }
    const mixinB = {
      b: 1,
      directives: {
        b: b
      },
      created: f2
    }
    const result = mergeOptions(
      {},
      {
        directives: {
          c: c
        },
        template: 'bar',
        mixins: [mixinA, mixinB],
        created: f3
      }
    )
    expect(result.a).toBe(1)
// ... (91 more lines)

Dependencies

  • index
  • vue

Frequently Asked Questions

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