Skip to content

Commit

Permalink
fix: use new interceptor constructor param order
Browse files Browse the repository at this point in the history
BREAKING CHANGE: new Interceptor(endpoint,options)
  • Loading branch information
arlac77 committed Nov 22, 2019
1 parent d7d298f commit 2830b54
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/ava-interceptor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function interceptorTest(
) {
t.is(Factory.name, type);

const instance = new Factory(undefined, endpoint);
const instance = new Factory(endpoint, undefined);

t.is(instance.type, type);
t.is(instance.endpoint, endpoint);
Expand All @@ -28,7 +28,7 @@ export async function interceptorTest(

await further(t, instance, false);

const instanceWithConfig = new Factory(config, endpoint);
const instanceWithConfig = new Factory(endpoint, config);

t.is(instanceWithConfig.type, type);
t.is(instanceWithConfig.endpoint, endpoint);
Expand Down
6 changes: 3 additions & 3 deletions src/mock-receive-interceptor.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ConnectorMixin } from 'kronos-interceptor';
import { ConnectorMixin } from "@kronos-integration/interceptor";

/**
* @param validateFunction {Function} The function which will validate later on the received data
*/
export class MockReceiveInterceptor extends ConnectorMixin(class {}) {
constructor(validateFunction) {
super();
constructor(endpoint, validateFunction) {
super(endpoint);

Object.defineProperties(this, {
validateFunction: {
Expand Down
3 changes: 0 additions & 3 deletions src/module.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@ export {
} from './interceptor-support.mjs';

export { MockReadStream } from './mock-read-stream.mjs';
/*
export { MockReceiveInterceptor } from './mock-receive-interceptor.mjs';
*/

0 comments on commit 2830b54

Please sign in to comment.