Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contract-case/case-plugin-base

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contract-case/case-plugin-base - npm Package Compare versions

Comparing version 0.16.3 to 0.17.0

dist/case-plugin-base.d.ts

3

dist/src/context/context.d.ts

@@ -0,4 +1,3 @@

import { AnyCaseMatcher, AnyMockDescriptor, AnyCaseMatcherOrData, AnyData } from '@contract-case/case-plugin-dsl-types';
import type { MatchContext, RunContext, TraversalFns, LogLevelContext, ResultFormatter, DataContext, MatchContextWithoutLookup, ContractLookupFns } from './types';
import { AnyCaseMatcher, AnyCaseMatcherOrData, AnyData } from '../matchers/types';
import { AnyMockDescriptor } from '../mocks/nodes.types';
import { Logger } from '../logger/types';

@@ -5,0 +4,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.locationString = exports.addLocation = exports.applyNodeToContext = exports.constructMatchContext = exports.constructDataContext = exports.foldIntoContext = void 0;
const case_plugin_dsl_types_1 = require("@contract-case/case-plugin-dsl-types");
const types_1 = require("../matchers/types");
const nodes_types_1 = require("../mocks/nodes.types");
const shouldLog_1 = require("../logger/shouldLog");

@@ -50,3 +50,3 @@ /**

const newContext = {
...((0, types_1.isCaseNode)(caseNodeOrData) || (0, nodes_types_1.isCaseMock)(caseNodeOrData)
...((0, types_1.isCaseNode)(caseNodeOrData) || (0, case_plugin_dsl_types_1.isCaseMock)(caseNodeOrData)
? (0, exports.foldIntoContext)(caseNodeOrData, context)

@@ -53,0 +53,0 @@ : context),

@@ -0,5 +1,5 @@

import { AnyCaseMatcherOrData, AnyCaseMatcher, AnyData } from '@contract-case/case-plugin-dsl-types';
import { CaseExample } from '../core/contract/types';
import { LogLevel, Logger } from '../logger/types';
import { CaseError, MatchResult } from '../matchers/errors.types';
import { AnyCaseMatcherOrData, AnyData, AnyCaseMatcher } from '../matchers/matchers.types';
/**

@@ -6,0 +6,0 @@ * Indicates that we are doing a general shape match in this context

@@ -0,5 +1,3 @@

import { AnyMockDescriptor, AnyCaseMatcherOrData, AnyState } from '@contract-case/case-plugin-dsl-types';
import { CaseError } from '../../matchers/errors.types';
import { AnyCaseMatcherOrData } from '../../matchers/matchers.types';
import { AnyMockDescriptor } from '../../mocks/nodes.types';
import { AnyState } from '../states';
export interface CaseContractDescription {

@@ -6,0 +4,0 @@ consumerName: string;

export * from './contract';
export * from './states';
//# sourceMappingURL=index.d.ts.map

@@ -18,3 +18,2 @@ "use strict";

__exportStar(require("./contract"), exports);
__exportStar(require("./states"), exports);
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import { AnyCaseMatcher } from '../matchers/types';
import { AnyCaseMatcher } from '@contract-case/case-plugin-dsl-types';
import type { DataContext } from '../context/types';

@@ -3,0 +3,0 @@ /**

@@ -0,3 +1,3 @@

import { AnyCaseMatcher } from '@contract-case/case-plugin-dsl-types';
import { VerifyTriggerReturnObjectError } from '../errors/VerifyTriggerReturnObjectError';
import { AnyCaseMatcher } from './matchers.types';
/**

@@ -4,0 +4,0 @@ * Represents an error from a matcher

@@ -0,4 +1,4 @@

import { AnyData } from '@contract-case/case-plugin-dsl-types';
import { MatchContext } from '../context/types';
import { MatchResult } from './errors.types';
import { AnyData } from './matchers.types';
import { IsCaseNodeForType } from './utility.types';

@@ -5,0 +5,0 @@ /**

@@ -1,2 +0,2 @@

import { AnyCaseMatcher } from './matchers.types';
import { AnyCaseMatcher } from '@contract-case/case-plugin-dsl-types';
/**

@@ -3,0 +3,0 @@ * Type guard to determine if an object is a ContractCase matcher descriptor or not

@@ -1,3 +0,2 @@

import { LookupableMatcher } from './lookup.types';
import { AnyCaseMatcherOrData } from './matchers.types';
import { AnyCaseMatcherOrData, LookupableMatcher } from '@contract-case/case-plugin-dsl-types';
/**

@@ -4,0 +3,0 @@ * Creates a matcher descriptor for a lookupable matcher.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.coreLookupMatcher = void 0;
const lookup_types_1 = require("./lookup.types");
const case_plugin_dsl_types_1 = require("@contract-case/case-plugin-dsl-types");
/**

@@ -19,3 +19,3 @@ * Creates a matcher descriptor for a lookupable matcher.

const coreLookupMatcher = (uniqueName, child) => ({
'_case:matcher:type': lookup_types_1.LOOKUP_MATCHER_TYPE,
'_case:matcher:type': case_plugin_dsl_types_1.LOOKUP_MATCHER_TYPE,
'_case:matcher:uniqueName': uniqueName,

@@ -22,0 +22,0 @@ '_case:matcher:child': child,

@@ -0,3 +1,3 @@

import { AnyCaseMatcherOrData } from '@contract-case/case-plugin-dsl-types';
import { MatchContext } from '../context/types';
import { AnyCaseMatcherOrData } from './matchers.types';
/**

@@ -4,0 +4,0 @@ * During a matcher execution, this function can be called to ensure that the

@@ -0,4 +1,4 @@

import { AnyCaseMatcher } from '@contract-case/case-plugin-dsl-types';
import { MatchContext } from '../../context/types';
import { CaseError, MatchResult } from '../errors.types';
import { AnyCaseMatcher } from '../matchers.types';
/**

@@ -5,0 +5,0 @@ * Helper function that will return an error if the test condition is met, or a non-erroring {@link MatchResult} otherwise.

export * from './errors.types';
export * from './executors.types';
export * from './guards.types';
export * from './matchers.types';
export * from './lookup.types';
export * from './utility.types';
//# sourceMappingURL=types.d.ts.map

@@ -20,5 +20,3 @@ "use strict";

__exportStar(require("./guards.types"), exports);
__exportStar(require("./matchers.types"), exports);
__exportStar(require("./lookup.types"), exports);
__exportStar(require("./utility.types"), exports);
//# sourceMappingURL=types.js.map

@@ -1,2 +0,2 @@

import { AnyCaseMatcher, AnyLeafOrStructure } from './matchers.types';
import { AnyCaseMatcher, AnyLeafOrStructure } from '@contract-case/case-plugin-dsl-types';
/**

@@ -3,0 +3,0 @@ * A matcher descriptor that has an example

@@ -0,25 +1,4 @@

import { AnyCaseMatcherOrData, AnyMockDescriptor, CaseMockDescriptorFor, SetupInfoFor } from '@contract-case/case-plugin-dsl-types';
import { MatchContext } from '../context/types';
import { AnyCaseMatcherOrData } from '../matchers/matchers.types';
import { AnyMockDescriptor, CaseMockDescriptorFor, HasTypeForMockDescriptor } from './nodes.types';
type VariableValue = any;
/**
* The base SetupInfo provided to all mock setup functions and triggers.
* @public
* @remarks
* All SetupInfo objects extend this type
*/
export type BaseSetupInfo = {
/**
* Variables provided by state setup functions
*/
variables: Record<string, VariableValue>;
};
/**
* Helper type to extract a specific mock's SetupInfo object form all known SetupInfo objects
* @public
* @typeParam AllSetupInfo - All known SetupInfo objects
* @typeParam T - the type of the mock descriptor that you want to get the SetupInfo for.
*/
export type SetupInfoFor<AllSetupInfo, T extends string> = Extract<AllSetupInfo, HasTypeForMockDescriptor<T>> & BaseSetupInfo;
/**
* Represents the output state of a mock's execution, including what was expected.

@@ -80,3 +59,2 @@ * @public

export type MockExecutorFn<AllMockDescriptors extends AnyMockDescriptor, AllSetupInfo, T extends string> = (mock: CaseMockDescriptorFor<AllMockDescriptors, T>, context: MatchContext) => Promise<MockData<AllSetupInfo, T>>;
export {};
//# sourceMappingURL=executors.types.d.ts.map

@@ -0,3 +1,3 @@

import { AnyMockDescriptor } from '@contract-case/case-plugin-dsl-types';
import { MatchContext } from '../context/types';
import { AnyMockDescriptor } from './nodes.types';
/**

@@ -4,0 +4,0 @@ * Helper function that will name this mock if it isn't already named.

export * from './executors.types';
export * from './nodes.types';
//# sourceMappingURL=types.d.ts.map

@@ -18,3 +18,2 @@ "use strict";

__exportStar(require("./executors.types"), exports);
__exportStar(require("./nodes.types"), exports);
//# sourceMappingURL=types.js.map

@@ -0,5 +1,5 @@

import { AnyMockDescriptor } from '@contract-case/case-plugin-dsl-types';
import { MatcherExecutor } from './matchers/types';
import { CaseMatcherFor, IsCaseNodeForType } from './matchers/utility.types';
import { MockExecutorFn } from './mocks/executors.types';
import { AnyMockDescriptor } from './mocks/nodes.types';
export * from './corePlugins';

@@ -6,0 +6,0 @@ export * from './context/types';

{
"name": "@contract-case/case-plugin-base",
"version": "0.16.3",
"version": "0.17.0",
"description": "Plugin framework for writing plugins for the ContractCase test framework",

@@ -69,5 +69,6 @@ "keywords": [

"dependencies": {
"@contract-case/case-plugin-dsl-types": "0.17.0",
"pretty-format": "^29.7.0"
},
"gitHead": "c49c7bfac22bc45b31ca502946d06136dcbc976c"
"gitHead": "8dd87d186d45b9d311b3b2129ae6a81853897d04"
}

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

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

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

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

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

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc