File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ export class Vehicle {
82
82
bannedChars,
83
83
} ) } ${ this . faker . random . alphaNumeric ( 1 , {
84
84
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 #
86
86
. toUpperCase ( ) ;
87
87
}
88
88
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ const seededRuns = [
24
24
model : 'Colorado' ,
25
25
type : 'Coupe' ,
26
26
fuel : 'Electric' ,
27
- vin : '8J579HF1A7MK33575 ' ,
27
+ vin : '8J579HF1A7MK33574 ' ,
28
28
color : 'black' ,
29
29
vrm : 'GO12HOL' ,
30
30
bicycle : 'Cyclocross Bicycle' ,
@@ -38,7 +38,7 @@ const seededRuns = [
38
38
model : '2' ,
39
39
type : 'Wagon' ,
40
40
fuel : 'Hybrid' ,
41
- vin : 'XFWS74Z1N5S678768 ' ,
41
+ vin : 'XFWS74Z1N5S678767 ' ,
42
42
color : 'azure' ,
43
43
vrm : 'YL87FDZ' ,
44
44
bicycle : 'Triathlon/Time Trial Bicycle' ,
@@ -107,6 +107,15 @@ describe('vehicle', () => {
107
107
} ) ;
108
108
} ) ;
109
109
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
+
110
119
describe ( 'model()' , ( ) => {
111
120
it ( 'should return random vehicle model' , ( ) => {
112
121
const model = faker . vehicle . model ( ) ;
You can’t perform that action at this time.
0 commit comments