This repository has been archived by the owner on Aug 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(shared): added metadata logger box to extension
- Loading branch information
1 parent
289784a
commit 294f813
Showing
37 changed files
with
1,257 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { getArbitrary } from 'fast-check-io-ts'; | ||
import { Supporter } from '../models/Supporter'; | ||
import * as t from 'io-ts'; | ||
|
||
const { creationTime, lastActivity, ...supporterProps } = Supporter.type.props; | ||
export const SupporterArb = getArbitrary( | ||
t.strict({ | ||
...supporterProps, | ||
}) | ||
).map((cc) => ({ | ||
...cc, | ||
creationTime: new Date(), | ||
lastActivity: new Date(), | ||
})); |
32 changes: 32 additions & 0 deletions
32
packages/shared/src/arbitraries/contributions/ContributionEvent.arb.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { getArbitrary } from 'fast-check-io-ts'; | ||
import { | ||
ADVContributionEvent, | ||
ContributionEvent, | ||
VideoContributionEvent, | ||
} from '../../models/ContributionEvent'; | ||
import * as t from 'io-ts'; | ||
import fc from 'fast-check'; | ||
|
||
const { ...videoContributionEventProps } = VideoContributionEvent.type.props; | ||
export const VideoContributionEventArb = getArbitrary( | ||
t.strict({ | ||
...videoContributionEventProps, | ||
}) | ||
).map((cc): any => ({ | ||
...cc, | ||
clientTime: new Date(), | ||
})); | ||
|
||
const { ...advContributionEventProps } = ADVContributionEvent.type.props; | ||
export const ADVContributionEventArb = getArbitrary( | ||
t.strict({ | ||
...advContributionEventProps, | ||
}) | ||
).map((cc) => ({ | ||
...cc, | ||
})); | ||
|
||
export const ContributionEventArb: fc.Arbitrary<ContributionEvent> = fc.oneof( | ||
VideoContributionEventArb, | ||
ADVContributionEventArb | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.