@tapjs/intercept
Advanced tools
Comparing version 1.0.3 to 1.1.0
@@ -22,2 +22,3 @@ import { TapPlugin, TestBase } from '@tapjs/core'; | ||
args: OverloadParams<F>; | ||
receiver: any; | ||
at?: CallSiteLike; | ||
@@ -141,2 +142,3 @@ stack?: string; | ||
export interface InterceptResultBase { | ||
receiver: any; | ||
at?: CallSiteLike; | ||
@@ -143,0 +145,0 @@ stack?: string; |
@@ -97,2 +97,3 @@ "use strict"; | ||
resList.push({ | ||
receiver: this, | ||
type: 'get', | ||
@@ -141,2 +142,3 @@ at: (0, stack_1.at)(interceptor.get), | ||
resList.push({ | ||
receiver: this, | ||
type: 'set', | ||
@@ -233,2 +235,3 @@ at: (0, stack_1.at)(interceptor.set), | ||
const res = { | ||
receiver: this, | ||
args, | ||
@@ -235,0 +238,0 @@ at: (0, stack_1.at)(wrapped), |
@@ -22,2 +22,3 @@ import { TapPlugin, TestBase } from '@tapjs/core'; | ||
args: OverloadParams<F>; | ||
receiver: any; | ||
at?: CallSiteLike; | ||
@@ -141,2 +142,3 @@ stack?: string; | ||
export interface InterceptResultBase { | ||
receiver: any; | ||
at?: CallSiteLike; | ||
@@ -143,0 +145,0 @@ stack?: string; |
@@ -94,2 +94,3 @@ import { plugin as TeardownPlugin } from '@tapjs/after'; | ||
resList.push({ | ||
receiver: this, | ||
type: 'get', | ||
@@ -138,2 +139,3 @@ at: at(interceptor.get), | ||
resList.push({ | ||
receiver: this, | ||
type: 'set', | ||
@@ -230,2 +232,3 @@ at: at(interceptor.set), | ||
const res = { | ||
receiver: this, | ||
args, | ||
@@ -232,0 +235,0 @@ at: at(wrapped), |
{ | ||
"name": "@tapjs/intercept", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "a built-in tap extension for t.intercept() and t.capture()", | ||
@@ -44,7 +44,7 @@ "type": "module", | ||
"peerDependencies": { | ||
"@tapjs/core": "1.0.3" | ||
"@tapjs/core": "1.1.0" | ||
}, | ||
"dependencies": { | ||
"@tapjs/after": "1.0.3", | ||
"@tapjs/stack": "1.0.0" | ||
"@tapjs/after": "1.0.4", | ||
"@tapjs/stack": "1.1.0" | ||
}, | ||
@@ -51,0 +51,0 @@ "engines": { |
@@ -73,5 +73,5 @@ # `@tapjs/intercept` | ||
t.match(results(), [ | ||
{ type: 'get', value: '1.2.3', success: true }, | ||
{ type: 'set', value: '2.4.6', success: false }, | ||
{ type: 'get', value: '1.2.3', success: true }, | ||
{ receiver: process, type: 'get', value: '1.2.3', success: true }, | ||
{ receiver: process, type: 'set', value: '2.4.6', success: false }, | ||
{ receiver: process, type: 'get', value: '1.2.3', success: true }, | ||
]) | ||
@@ -92,4 +92,5 @@ }) | ||
The `results()` method will return an array of objects with | ||
an `args` array, an `at` CallSiteLike object, and either | ||
The `results()` method will return an array of objects with a | ||
`receiver` property indicating the `this`-context of the method | ||
call, an `args` array, an `at` CallSiteLike object, and either | ||
`threw: true` or `returned: <value>`. | ||
@@ -111,2 +112,3 @@ | ||
- `receiver` the object where the set/get is happening | ||
- `type` 'get' for get operations, 'set' for set operations | ||
@@ -113,0 +115,0 @@ - `value` The value that was returned by a get, or set in a |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
99131
969
125
+ Added@tapjs/after@1.0.4(transitive)
+ Added@tapjs/core@1.1.0(transitive)
+ Added@tapjs/stack@1.1.0(transitive)
+ Added@tapjs/test@1.1.0(transitive)
+ Addedtap-parser@15.1.0(transitive)
- Removed@tapjs/after@1.0.3(transitive)
- Removed@tapjs/core@1.0.3(transitive)
- Removed@tapjs/stack@1.0.0(transitive)
- Removed@tapjs/test@1.0.3(transitive)
- Removedtap-parser@15.0.0(transitive)
Updated@tapjs/after@1.0.4
Updated@tapjs/stack@1.1.0