Skip to content

Commit

Permalink
chore: Improve formatting of ids of more specific injection tokens
Browse files Browse the repository at this point in the history
Co-authored-by: Janne Savolainen <[email protected]>
Signed-off-by: Iku-turso <[email protected]>
Iku-turso and jansav committed Apr 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 992551d commit 79e3d3a
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ export const getInjectionToken = ({

const specificToken = specificTokenCandidate;

specificToken.id = `${generalToken.id}(${specificToken.id})`;
specificToken.id = `${generalToken.id}/${specificToken.id}`;
specificToken.specificTokenOf = generalToken;
specificToken.decorable = generalToken.decorable;

Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ describe('injecting-a-specific-implementation-of-a-token', () => {
}),
);
}).toThrow(
'Tried to inject non-registered injectable "irrelevant" -> "some-injection-token(some-speciality)".',
'Tried to inject non-registered injectable "irrelevant" -> "some-injection-token/some-speciality".',
);
});

@@ -160,7 +160,7 @@ describe('injecting-a-specific-implementation-of-a-token', () => {
}),
);
}).toThrow(
'Tried to inject single injectable for injection token "some-injection-token(some-speciality)" but found multiple injectables: "some-injectable-with-colliding-speciality", "some-other injectable-with-colliding-speciality"',
'Tried to inject single injectable for injection token "some-injection-token/some-speciality" but found multiple injectables: "some-injectable-with-colliding-speciality", "some-other injectable-with-colliding-speciality"',
);
});

@@ -172,7 +172,7 @@ describe('injecting-a-specific-implementation-of-a-token', () => {
}),
);
}).toThrow(
'Tried to inject non-registered injectable "irrelevant" -> "some-injection-token(some-speciality)".',
'Tried to inject non-registered injectable "irrelevant" -> "some-injection-token/some-speciality".',
);
});
});
@@ -452,7 +452,7 @@ describe('injecting-a-specific-implementation-of-a-token', () => {
'irrelevant',
);
}).toThrow(
'Tried to inject non-registered injectable "irrelevant" -> "some-injection-token(some-speciality)".',
'Tried to inject non-registered injectable "irrelevant" -> "some-injection-token/some-speciality".',
);
});

0 comments on commit 79e3d3a

Please sign in to comment.