Skip to content

Commit

Permalink
test: add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
notaphplover committed Dec 4, 2024
1 parent b8dcd4f commit e38e7bc
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/test/planning/planner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,28 @@ describe('Planner', () => {
expect(actualShurikenRequest?.target.serviceIdentifier).eql(shurikenId);
});

it('Should be able to create a basic plan with optional metadata', () => {
const ninjaId: string = 'Ninja';

const container: Container = new Container();

// Actual
const actualPlan: Plan = plan(
new MetadataReader(),
container,
TargetTypeEnum.Variable,
ninjaId,
{
isMultiInject: false,
isOptional: true,
},
).plan;
const actualNinjaRequest: interfaces.Request = actualPlan.rootRequest;

expect(actualNinjaRequest.serviceIdentifier).eql(ninjaId);
expect(actualNinjaRequest.bindings).to.have.length(0);
});

it('Should throw when circular dependencies found', () => {
@injectable()
class D {
Expand Down

0 comments on commit e38e7bc

Please sign in to comment.