Skip to content

Commit

Permalink
chore: feature event formatter format style
Browse files Browse the repository at this point in the history
  • Loading branch information
nunogois committed Sep 24, 2024
1 parent 4893203 commit 74c6c7d
Show file tree
Hide file tree
Showing 10 changed files with 439 additions and 403 deletions.
8 changes: 3 additions & 5 deletions src/lib/addons/datadog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
import {
type FeatureEventFormatter,
FeatureEventFormatterMd,
LinkStyle,
} from './feature-event-formatter-md';
import type { IEvent } from '../types/events';
import type { IntegrationEventState } from '../features/integration-events/integration-events-store';
Expand Down Expand Up @@ -38,10 +37,9 @@ export default class DatadogAddon extends Addon {

constructor(config: IAddonConfig) {
super(definition, config);
this.msgFormatter = new FeatureEventFormatterMd(
config.unleashUrl,
LinkStyle.MD,
);
this.msgFormatter = new FeatureEventFormatterMd({
unleashUrl: config.unleashUrl,
});
this.flagResolver = config.flagResolver;
}

Expand Down
359 changes: 359 additions & 0 deletions src/lib/addons/feature-event-formatter-md-events.ts

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/lib/addons/feature-event-formatter-md.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,9 @@ const testCases: [string, IEvent][] = [

testCases.forEach(([description, event]) =>
test(`Should format specialised text for events ${description}`, () => {
const formatter = new FeatureEventFormatterMd('unleashUrl');
const formatter = new FeatureEventFormatterMd({
unleashUrl: 'unleashUrl',
});
const formattedEvent = formatter.format(event);
expect(formattedEvent).toMatchSnapshot();
}),
Expand Down
Loading

0 comments on commit 74c6c7d

Please sign in to comment.