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

inject.spec.ts — vue Source File

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

File typescript VueCore 5 imports

Entity Profile

Dependency Diagram

graph LR
  c7d0729b_b07c_6691_9df1_c8b8ed7dfa51["inject.spec.ts"]
  09b3d58b_2586_2d23_1760_3ec3fe090d46["test-object-option.ts"]
  c7d0729b_b07c_6691_9df1_c8b8ed7dfa51 --> 09b3d58b_2586_2d23_1760_3ec3fe090d46
  4a7600ac_90db_8739_d900_439c1c18fef7["testObjectOption"]
  c7d0729b_b07c_6691_9df1_c8b8ed7dfa51 --> 4a7600ac_90db_8739_d900_439c1c18fef7
  db9e7bef_009d_3918_6e7d_543a36a38d75["vue"]
  c7d0729b_b07c_6691_9df1_c8b8ed7dfa51 --> db9e7bef_009d_3918_6e7d_543a36a38d75
  3897e8b5_9242_b5d7_bf5f_783d40cceb59["index"]
  c7d0729b_b07c_6691_9df1_c8b8ed7dfa51 --> 3897e8b5_9242_b5d7_bf5f_783d40cceb59
  90a2398a_1498_3263_c62e_0c064dd2c9b3["index"]
  c7d0729b_b07c_6691_9df1_c8b8ed7dfa51 --> 90a2398a_1498_3263_c62e_0c064dd2c9b3
  style c7d0729b_b07c_6691_9df1_c8b8ed7dfa51 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import Vue from 'vue'
import { Observer } from 'core/observer/index'
import { isNative, isObject, hasOwn, nextTick } from 'core/util/index'
import testObjectOption from '../../../helpers/test-object-option'

describe('Options provide/inject', () => {
  testObjectOption('inject')

  let injected
  const injectedComp = {
    inject: ['foo', 'bar'],
    render() {},
    created() {
      injected = [this.foo, this.bar]
    }
  }

  beforeEach(() => {
    injected = null
  })

  it('should work', () => {
    new Vue({
      template: `<child/>`,
      provide: {
        foo: 1,
        bar: false
      },
      components: {
        child: {
          template: `<injected-comp/>`,
          components: {
            injectedComp
          }
        }
      }
    }).$mount()

    expect(injected).toEqual([1, false])
  })

  it('should use closest parent', () => {
    new Vue({
      template: `<child/>`,
      provide: {
        foo: 1,
        bar: null
      },
      components: {
        child: {
          provide: {
            foo: 3
          },
          template: `<injected-comp/>`,
          components: {
            injectedComp
          }
        }
      }
    }).$mount()
// ... (664 more lines)

Domain

Dependencies

Frequently Asked Questions

What does inject.spec.ts do?
inject.spec.ts is a source file in the vue codebase, written in typescript. It belongs to the VueCore domain.
What does inject.spec.ts depend on?
inject.spec.ts imports 5 module(s): index, index, test-object-option.ts, testObjectOption, vue.
Where is inject.spec.ts in the architecture?
inject.spec.ts is located at test/unit/features/options/inject.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