test: test for directives

This commit is contained in:
Evan You
2019-09-02 12:09:29 -04:00
parent 94e72481b8
commit aac807bc63
8 changed files with 203 additions and 36 deletions

View File

@@ -23,12 +23,12 @@ export function popWarningContext() {
export function warn(msg: string, ...args: any[]) {
// TODO app level warn handler
console.warn(`[Vue warn]: ${msg}`, ...args)
const trace = getComponentTrace()
if (!trace.length) {
// avoid spamming console during tests
if (typeof process !== 'undefined' && process.env.NODE_ENV === 'test') {
return
}
// avoid spamming test output
if (typeof process !== 'undefined' && process.env.NODE_ENV === 'test') {
const trace = getComponentTrace()
if (!trace.length) {
return
}
if (trace.length > 1 && console.groupCollapsed) {