Comparing version 2.3.0 to 2.3.1
@@ -24,2 +24,3 @@ "use strict"; | ||
name: Symbol('__Spy_name__'), | ||
snap: Symbol('__Spy_snap__'), | ||
isSpy: Symbol('__Spy_isSpy__'), | ||
@@ -33,3 +34,3 @@ func: Symbol('__Spy_func__'), | ||
test: v => v && v[Symbols.isSpy], | ||
print: spy => `Spy(${spy[Symbols.name]})` | ||
print: spy => spy[Symbols.snap] | ||
}); | ||
@@ -250,3 +251,3 @@ const DefaultSettings = { | ||
class Spy { | ||
constructor(name = 'the spy', __mock) { | ||
constructor(name = '', __mock) { | ||
const spy = function (...args) { | ||
@@ -261,7 +262,10 @@ spy[Symbols.calls].push({ | ||
spy[Symbols.index] = registry.push(__mock.obj, __mock.methodName); | ||
spy[Symbols.name] = `the spy on '${name}'`; | ||
spy[Symbols.snap] = `Spy.on(${name})`; | ||
} else { | ||
spy[Symbols.index] = null; | ||
spy[Symbols.name] = name || 'the spy'; | ||
spy[Symbols.snap] = `Spy(${name})`; | ||
} | ||
spy[Symbols.name] = name; | ||
spy[Symbols.isSpy] = true; | ||
@@ -305,3 +309,3 @@ | ||
__LOCK__ = false; | ||
const spy = new Spy(`the spy on '${methodName}'`, { | ||
const spy = new Spy(methodName, { | ||
obj, | ||
@@ -308,0 +312,0 @@ methodName |
{ | ||
"name": "spy4js", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Smart, compact and powerful spy test framework", | ||
@@ -5,0 +5,0 @@ "jest": { |
Sorry, the diff of this file is not supported yet
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
85084
531