File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ export class Vehicle {
8282 bannedChars,
8383 } ) } ${ this . faker . random . alphaNumeric ( 1 , {
8484 bannedChars,
85- } ) } ${ this . faker . datatype . number ( { min : 10000 , max : 100000 } ) } ` // return five digit #
85+ } ) } ${ this . faker . datatype . number ( { min : 10000 , max : 99999 } ) } ` // return five digit #
8686 . toUpperCase ( ) ;
8787 }
8888
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ const seededRuns = [
2424 model : 'Colorado' ,
2525 type : 'Coupe' ,
2626 fuel : 'Electric' ,
27- vin : '8J579HF1A7MK33575 ' ,
27+ vin : '8J579HF1A7MK33574 ' ,
2828 color : 'black' ,
2929 vrm : 'GO12HOL' ,
3030 bicycle : 'Cyclocross Bicycle' ,
@@ -38,7 +38,7 @@ const seededRuns = [
3838 model : '2' ,
3939 type : 'Wagon' ,
4040 fuel : 'Hybrid' ,
41- vin : 'XFWS74Z1N5S678768 ' ,
41+ vin : 'XFWS74Z1N5S678767 ' ,
4242 color : 'azure' ,
4343 vrm : 'YL87FDZ' ,
4444 bicycle : 'Triathlon/Time Trial Bicycle' ,
@@ -107,6 +107,15 @@ describe('vehicle', () => {
107107 } ) ;
108108 } ) ;
109109
110+ describe ( 'vin()' , ( ) => {
111+ it ( 'returns valid vin number' , ( ) => {
112+ const vin = faker . vehicle . vin ( ) ;
113+ expect ( vin ) . toMatch (
114+ / ^ ( [ A - H J - N P R - Z 0 - 9 ] { 10 } [ A - H J - N P R - Z 0 - 9 ] { 1 } [ A - H J - N P R - Z 0 - 9 ] { 1 } \d { 5 } ) $ /
115+ ) ;
116+ } ) ;
117+ } ) ;
118+
110119 describe ( 'model()' , ( ) => {
111120 it ( 'should return random vehicle model' , ( ) => {
112121 const model = faker . vehicle . model ( ) ;
You can’t perform that action at this time.
0 commit comments