@@ -13,6 +13,14 @@ const refDate = '2021-02-21T17:09:15.711Z';
1313
1414describe ( 'date' , ( ) => {
1515 seededTests ( faker , 'date' , ( t ) => {
16+ t . describe ( 'anytime' , ( t ) => {
17+ t . it ( 'with only string refDate' , { refDate } )
18+ . it ( 'with only Date refDate' , { refDate : new Date ( refDate ) } )
19+ . it ( 'with only number refDate' , {
20+ refDate : new Date ( refDate ) . getTime ( ) ,
21+ } ) ;
22+ } ) ;
23+
1624 t . describeEach (
1725 'past' ,
1826 'future'
@@ -188,12 +196,21 @@ describe('date', () => {
188196 } ) ;
189197
190198 // No changes to these methods
191- t . skip ( 'birthdate' ) . skip ( 'month' ) . skip ( 'weekday' ) ;
199+ t . skip ( 'anytime' ) . skip ( ' birthdate') . skip ( 'month' ) . skip ( 'weekday' ) ;
192200 } ) ;
193201 } ) ;
194202
195203 describe ( `random seeded tests for seed ${ faker . seed ( ) } ` , ( ) => {
196204 for ( let i = 1 ; i <= NON_SEEDED_BASED_RUN ; i ++ ) {
205+ describe ( 'anytime()' , ( ) => {
206+ it ( 'should return a date' , ( ) => {
207+ const actual = faker . date . anytime ( ) ;
208+
209+ expect ( actual ) . toBeDefined ( ) ;
210+ expect ( actual ) . toBeInstanceOf ( Date ) ;
211+ } ) ;
212+ } ) ;
213+
197214 describe ( 'past()' , ( ) => {
198215 it ( 'should return a date 5 years in the past' , ( ) => {
199216 const today = new Date ( ) ;
0 commit comments