@@ -84,36 +84,24 @@ describe("normalizeUrl", () => {
8484} ) ;
8585
8686describe ( "getCliEnvironment" , ( ) => {
87- test ( "returns 'development' in dev mode (SENTRY_CLI_VERSION not injected)" , ( ) => {
88- // In test/dev mode, CLI_VERSION is "0.0.0-dev" because the build-time
89- // constant SENTRY_CLI_VERSION is never defined.
87+ test ( "returns 'development' in dev mode (no build injection)" , ( ) => {
88+ // CLI_VERSION is "0.0.0-dev" when SENTRY_CLI_VERSION is not injected
9089 expect ( getCliEnvironment ( ) ) . toBe ( "development" ) ;
9190 } ) ;
9291
93- test ( "derivation logic: stable versions → 'production'" , ( ) => {
94- // Verify the logic that would run in production builds by checking
95- // the conditions directly against known version formats.
96- const stableVersions = [ "0.20.0" , "1.0.0" , "0.23.0" , "2.5.1" ] ;
97- for ( const v of stableVersions ) {
98- expect ( v === "0.0.0-dev" ) . toBe ( false ) ;
99- expect ( v . includes ( "-dev." ) ) . toBe ( false ) ;
100- // Both conditions false → would return "production"
101- }
92+ test ( "returns 'development' for '0.0.0-dev'" , ( ) => {
93+ expect ( getCliEnvironment ( "0.0.0-dev" ) ) . toBe ( "development" ) ;
10294 } ) ;
10395
104- test ( "derivation logic: nightly versions contain '-dev.'" , ( ) => {
105- const nightlyVersions = [ "0.24.0-dev.1740000000" , "1.0.0-dev.1700000000" ] ;
106- for ( const v of nightlyVersions ) {
107- expect ( v === "0.0.0-dev" ) . toBe ( false ) ;
108- expect ( v . includes ( "-dev." ) ) . toBe ( true ) ;
109- // First condition false, second true → would return "nightly"
110- }
96+ test ( "returns 'nightly' for nightly versions" , ( ) => {
97+ expect ( getCliEnvironment ( "0.24.0-dev.1740000000" ) ) . toBe ( "nightly" ) ;
98+ expect ( getCliEnvironment ( "1.0.0-dev.1700000000" ) ) . toBe ( "nightly" ) ;
11199 } ) ;
112100
113- test ( "derivation logic: dev fallback is exactly '0.0.0-dev' " , ( ) => {
114- const v = "0.0.0-dev" ;
115- expect ( v === "0 .0.0-dev" ) . toBe ( true ) ;
116- // First condition true → would return "development"
101+ test ( "returns 'production' for stable versions " , ( ) => {
102+ expect ( getCliEnvironment ( "0.20.0" ) ) . toBe ( "production" ) ;
103+ expect ( getCliEnvironment ( "1 .0.0" ) ) . toBe ( "production" ) ;
104+ expect ( getCliEnvironment ( "0.23.0" ) ) . toBe ( "production" ) ;
117105 } ) ;
118106} ) ;
119107
0 commit comments