-
Notifications
You must be signed in to change notification settings - Fork 273
Add global configuration settings #53
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
Conversation
Hm, is this the same as |
Theoretically it is, the PR is just to have feature parity with the Vue config API. |
let's make this global.
This is esp. useful for mocking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment about allowing passing globalProperties to as a mounting option - not sure if it makes sense (not something we support in beta iirc). If something is global, it should be applied on all components - what's the use case to override it locally?
looking good, lodash makes things so easy 🎉
d37a814
to
2ec6d17
Compare
# Conflicts: # src/types.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the conflict is gone, happy to merge this.
configGlobal = {}, | ||
mountGlobal = {} | ||
): GlobalMountOptions { | ||
return mergeWith({}, configGlobal, mountGlobal, (objValue, srcValue, key) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 🙌
import { GlobalMountOptions } from './types' | ||
|
||
export const config: { global: GlobalMountOptions } = { | ||
global: {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I add each of the properties here, with an empty array or object?
return { ...objValue, ...srcValue } | ||
case 'plugins': | ||
case 'mixins': | ||
return [...(objValue || []), ...(srcValue || [])].filter(Boolean) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not overwrite a plugin or mixin if defined globally first, it will concat them. That should be fine though?
# Conflicts: # src/mount.ts
This PR adds a global config object, to allow users to add global Mixins, mocks or others for all Test files.
Closes #35