@@ -53,3 +53,50 @@ describe("Swift Version Sync", () => {
5353 expect ( swiftVersion ) . toMatch ( semverRegex ) ;
5454 } ) ;
5555} ) ;
56+
57+ describe ( "Android Version Sync" , ( ) => {
58+ it ( "RNPlaidLinkSdkVersion.kt should match package.json version" , ( ) => {
59+ const kotlinFilePath = path . join (
60+ __dirname ,
61+ "../../android/src/main/java/expo/modules/plaidlinksdk/RNPlaidLinkSdkVersion.kt" ,
62+ ) ;
63+ const kotlinContent = fs . readFileSync ( kotlinFilePath , "utf-8" ) ;
64+
65+ const versionMatch = kotlinContent . match ( / S D K _ V E R S I O N \s * = \s * " ( [ ^ " ] + ) " / ) ;
66+
67+ expect ( versionMatch ) . not . toBeNull ( ) ;
68+
69+ if ( ! versionMatch ) {
70+ fail (
71+ "Could not find SDK_VERSION in RNPlaidLinkSdkVersion.kt. " +
72+ 'Expected format: const val SDK_VERSION = "X.X.X"' ,
73+ ) ;
74+ return ;
75+ }
76+
77+ const kotlinVersion = versionMatch [ 1 ] ;
78+ const packageVersion = packageJson . version ;
79+
80+ expect ( kotlinVersion ) . toBe ( packageVersion ) ;
81+ } ) ;
82+
83+ it ( "Android version should be a valid semver string" , ( ) => {
84+ const kotlinFilePath = path . join (
85+ __dirname ,
86+ "../../android/src/main/java/expo/modules/plaidlinksdk/RNPlaidLinkSdkVersion.kt" ,
87+ ) ;
88+ const kotlinContent = fs . readFileSync ( kotlinFilePath , "utf-8" ) ;
89+
90+ const versionMatch = kotlinContent . match ( / S D K _ V E R S I O N \s * = \s * " ( [ ^ " ] + ) " / ) ;
91+
92+ if ( ! versionMatch ) {
93+ fail ( "Could not find SDK_VERSION in Kotlin file" ) ;
94+ return ;
95+ }
96+
97+ const kotlinVersion = versionMatch [ 1 ] ;
98+ const semverRegex = / ^ \d + \. \d + \. \d + / ;
99+
100+ expect ( kotlinVersion ) . toMatch ( semverRegex ) ;
101+ } ) ;
102+ } ) ;
0 commit comments