Skip to content

Commit

Permalink
feat(context-module): new external plugin loader
Browse files Browse the repository at this point in the history
need the correct implementation when the CAL
service is ready to use
  • Loading branch information
aussedatlo committed Apr 30, 2024
1 parent 81a268e commit 8261cc8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { LoaderOptions } from "../models/LoaderOptions";
import { Transaction } from "../models/Transaction";
import { ExternalPluginLoader } from "./ExternalPluginLoader";

describe("ExternalPluginLoader", () => {
let loader: ExternalPluginLoader;
const transaction = {} as Transaction;

beforeEach(() => {
jest.restoreAllMocks();
loader = new ExternalPluginLoader();
});

describe("load function", () => {
it("should return an empty array", async () => {
const options = {} as LoaderOptions;

const result = await loader.load(transaction, options);

expect(result).toEqual([]);
});
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { LoaderOptions } from "../models/LoaderOptions";
import { Transaction } from "../models/Transaction";
import { ContextLoader } from "./ContextLoader";

export class ExternalPluginLoader implements ContextLoader {
constructor() {}

async load(_transaction: Transaction, _options: LoaderOptions) {
// TODO: implement the call to the CAL service when implemented
return Promise.resolve([]);
}
}

0 comments on commit 8261cc8

Please sign in to comment.