Skip to content

When mount the component, will error! #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
scq000 opened this issue Aug 20, 2017 · 5 comments
Closed

When mount the component, will error! #29

scq000 opened this issue Aug 20, 2017 · 5 comments

Comments

@scq000
Copy link

scq000 commented Aug 20, 2017

I found when I mount a component, it will render a commend node.But if I change the source of mount function like this:

export function mount (component, options) {
  if ( options === void 0 ) options = {};

  if (!window) {
    throwError('window is undefined, vue-test-utils needs to be run in a browser environment.\n You can run the tests in node using JSDOM');
  }

  var componentToMount = options.clone === false ? component : lodash.cloneDeep(component);
  // Remove cached constructor
  // delete componentToMount._Ctor;
  var vm = createConstructor(componentToMount, options);

  if (options.attachToDocument) {
    vm.$mount(createElement());
  } else {
    vm.$mount();
  }

  return new VueWrapper(vm, { attachedToDocument: !!options.attachToDocument })
}

I remove the statement delete componentToMount._Ctor, it will work!

@scq000
Copy link
Author

scq000 commented Aug 20, 2017

Oh, it's not this problem.

@scq000 scq000 closed this as completed Aug 20, 2017
@74sharlock
Copy link

@scq000 So what's the real problem? I have same question.

@maksnester
Copy link

Hey guys, what does attachedToDocument exist for? I tried to google it, but docs are uncertain about that, so I found this issue, so why not to ask right here 🤷‍♂️

@74sharlock
Copy link

@alendorff

#329

Maybe u open a new issue?

@maksnester
Copy link

@74sharlock sure, as you wish #1207

However issue like that looks a little excess for me, probably more general issue about documentation is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants