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

@luvio/adapter-test-library

Package Overview
Dependencies
Maintainers
12
Versions
334
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@luvio/adapter-test-library - npm Package Compare versions

Comparing version 0.154.8 to 0.154.9

dist/types/MockCrossEnvironmentNotifier.d.ts

36

dist/test-library.js

@@ -557,2 +557,36 @@ import sinon from 'sinon';

class MockCrossEnvironmentStorage {
constructor() {
this.environments = new Map();
}
registerEnvironmentForNotifications(notification) {
const identifier = (Math.random() + 1).toString(36).substring(2);
this.environments.set(identifier, notification);
return Promise.resolve({
identifier,
unsubscribe: () => {
this.environments.delete(identifier);
return Promise.resolve();
},
});
}
notifyCrossEnvironments(identifier, notification) {
this.environments.forEach((callback, id) => {
if (identifier !== id) {
callback(notification);
}
});
return Promise.resolve();
}
}
async function createMockCrossEnvironmentNotifier(listener, storage) {
const { identifier, unsubscribe } = await storage.registerEnvironmentForNotifications(listener);
return {
unsubscribe,
notifyCrossEnvironments: (notification) => {
return storage.notifyCrossEnvironments(identifier, notification);
},
};
}
// Use this util if you want to configure multiple network mocks in your test code.

@@ -642,2 +676,2 @@ // If you're only mocking one, we suggest you use buildLuvioWithNetwork instead.

export { ConnectivityState, MemoryDurableStorePersistence, MockDurableStore, buildErrorMockPayload, buildFetchResponse, buildLuvioInstance, buildLuvioWithNetwork, buildMockNetworkAdapter, buildSuccessMockPayload, customMatchers, flushPendingNetworkRequests, getMockFulfilledSnapshot, getMockLuvioWithFulfilledSnapshot, getMockNetworkAdapterCallCount, isImmutable, overrideMockNetworkResponses, resetMockNetworkAdapter, setMockNetworkPayloads, setNetworkConnectivity, setupCustomLuvioMatchers, stripProperties, testAdapterCompletesRoundtrip, testDeleteAdapterCompletesRoundtrip, verifyImmutable };
export { ConnectivityState, MemoryDurableStorePersistence, MockCrossEnvironmentStorage, MockDurableStore, buildErrorMockPayload, buildFetchResponse, buildLuvioInstance, buildLuvioWithNetwork, buildMockNetworkAdapter, buildSuccessMockPayload, createMockCrossEnvironmentNotifier, customMatchers, flushPendingNetworkRequests, getMockFulfilledSnapshot, getMockLuvioWithFulfilledSnapshot, getMockNetworkAdapterCallCount, isImmutable, overrideMockNetworkResponses, resetMockNetworkAdapter, setMockNetworkPayloads, setNetworkConnectivity, setupCustomLuvioMatchers, stripProperties, testAdapterCompletesRoundtrip, testDeleteAdapterCompletesRoundtrip, verifyImmutable };

@@ -7,2 +7,3 @@ export { MockPayload, ConnectivityState, buildMockNetworkAdapter, resetMockNetworkAdapter, getMockNetworkAdapterCallCount, buildSuccessMockPayload, buildErrorMockPayload, setMockNetworkPayloads, setNetworkConnectivity, buildFetchResponse, overrideMockNetworkResponses, flushPendingNetworkRequests, } from './network';

export { MockDurableStore } from './MockDurableStore';
export { createMockCrossEnvironmentNotifier, MockCrossEnvironmentStorage, } from './MockCrossEnvironmentNotifier';
export { MemoryDurableStorePersistence, DurableStorePersistence } from './durableStorePersistence';

@@ -9,0 +10,0 @@ export { testAdapterCompletesRoundtrip, buildLuvioWithNetwork, buildLuvioInstance, } from './adapterRoundtrip';

6

package.json
{
"name": "@luvio/adapter-test-library",
"version": "0.154.8",
"version": "0.154.9",
"description": "Test library for luvio adapters",

@@ -31,4 +31,4 @@ "repository": {

"devDependencies": {
"@luvio/engine": "^0.154.8",
"@luvio/environments": "^0.154.8",
"@luvio/engine": "^0.154.9",
"@luvio/environments": "^0.154.9",
"@types/sinon": "^7.5.2"

@@ -35,0 +35,0 @@ },

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