wip: invert compiler compat behavior default during tests

This commit is contained in:
Evan You
2021-04-16 12:26:17 -04:00
parent bbf708dbe9
commit ad97bbab85
2 changed files with 6 additions and 4 deletions

View File

@@ -102,7 +102,9 @@ export function checkCompatEnabled(
loc: SourceLocation | null,
...args: any[]
): boolean {
const enabled = getCompatValue(key, context) !== false
const value = getCompatValue(key, context)
// during tests, only enable when value is explicitly true
const enabled = __TEST__ ? value === true : value !== false
if (__DEV__ && enabled) {
warnDeprecation(key, context, loc, ...args)
}