jest-mock
Advanced tools
Comparing version 21.0.2 to 21.1.0
@@ -38,14 +38,20 @@ 'use strict'; | ||
const MOCK_CONSTRUCTOR_NAME = 'mockConstructor'; | ||
// $FlowFixMe | ||
/** | ||
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* | ||
*/const RESERVED_KEYWORDS = Object.assign(Object.create(null), { arguments: true, await: true, break: true, case: true, catch: true, class: true, const: true, continue: true, | ||
const MOCK_CONSTRUCTOR_NAME = 'mockConstructor'; /** | ||
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* | ||
*/const FUNCTION_NAME_RESERVED_PATTERN = /[\s!-\/:-@\[-`{-~]/;const FUNCTION_NAME_RESERVED_REPLACE = new RegExp(FUNCTION_NAME_RESERVED_PATTERN.source, 'g'); // $FlowFixMe | ||
const RESERVED_KEYWORDS = Object.assign(Object.create(null), { | ||
arguments: true, | ||
await: true, | ||
break: true, | ||
case: true, | ||
catch: true, | ||
class: true, | ||
const: true, | ||
continue: true, | ||
debugger: true, | ||
@@ -385,2 +391,3 @@ default: true, | ||
this._mockState.delete(f); | ||
return f; | ||
}; | ||
@@ -391,2 +398,3 @@ | ||
this._mockConfigRegistry.delete(f); | ||
return f; | ||
}; | ||
@@ -480,4 +488,4 @@ | ||
// as part of it's name. | ||
if (/[\s-]/.test(name)) { | ||
name = name.replace(/[\s-]/g, '$'); | ||
if (FUNCTION_NAME_RESERVED_PATTERN.test(name)) { | ||
name = name.replace(FUNCTION_NAME_RESERVED_REPLACE, '$'); | ||
} | ||
@@ -484,0 +492,0 @@ |
{ | ||
"name": "jest-mock", | ||
"version": "21.0.2", | ||
"version": "21.1.0", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88564
2408