Skip to content

Commit eb2fa8c

Browse files
committed
fix(detox): generate valid JSON in .detoxrc for non-expo apps
The detox application generator's .detoxrc.json template left a trailing comma after the last entry of the apps and configurations blocks when the optional expo-only entries were not emitted, producing invalid JSON for react-native apps. Move the comma inside the EJS conditional so it is only included when the following expo entry is also emitted.
1 parent 5095b4b commit eb2fa8c

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

packages/detox/src/generators/application/files/app/.detoxrc.json.template

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@
3535
"type": "android.apk",
3636
"build": "cd <%= offsetFromRoot %><%= appRoot %>/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release",
3737
"binaryPath": "<%= offsetFromRoot %><%= appRoot %>/android/app/build/outputs/apk/release/app-release.apk"
38-
},
39-
<% if (framework === 'expo') { %>
38+
}<% if (framework === 'expo') { %>,
4039
"android.local": {
4140
"type": "android.apk",
4241
"build": "<%= exec %> nx run <%= appFileName %>:build --platform android --profile preview --wait --local --no-interactive --output=<%= offsetFromRoot %><%= appRoot %>/dist/<%= appExpoName %>.apk",
4342
"binaryPath": "<%= offsetFromRoot %><%= appRoot %>/dist/<%= appExpoName %>.apk"
44-
},
45-
<% } %>
43+
}<% } %>
4644
},
4745
"devices": {
4846
"simulator": {
@@ -80,12 +78,10 @@
8078
"android.emu.debug": {
8179
"device": "emulator",
8280
"app": "android.debug"
83-
},
84-
<% if (framework === 'expo') { %>
81+
}<% if (framework === 'expo') { %>,
8582
"android.emu.local": {
8683
"device": "emulator",
8784
"app": "android.local"
88-
},
89-
<% } %>
85+
}<% } %>
9086
}
9187
}

0 commit comments

Comments
 (0)