sessionTerm.spec.tsx 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884
  1. import {
  2. commonTermsDescription,
  3. desktopTermDescriptions,
  4. getSessionTermDescription,
  5. mobileTermsDescription,
  6. SessionTerm,
  7. } from 'sentry/views/releases/utils/sessionTerm';
  8. describe('Release Health Session Term', function () {
  9. it('dotnet terms', function () {
  10. // Crashes
  11. const crashesSessionTerm = getSessionTermDescription(SessionTerm.CRASHES, 'dotnet');
  12. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  13. // Crashed
  14. const crashedSessionTerm = getSessionTermDescription(SessionTerm.CRASHED, 'dotnet');
  15. expect(crashedSessionTerm).toEqual(mobileTermsDescription.crashed);
  16. // Crash Free Users
  17. const crashFreeUsersSessionTerm = getSessionTermDescription(
  18. SessionTerm.CRASH_FREE_USERS,
  19. 'dotnet'
  20. );
  21. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  22. // Crash Free Sessions
  23. const crashFreeSessionTerm = getSessionTermDescription(
  24. SessionTerm.CRASH_FREE_SESSIONS,
  25. 'dotnet'
  26. );
  27. expect(crashFreeSessionTerm).toEqual(mobileTermsDescription['crash-free-sessions']);
  28. // Abnormal
  29. const abnormalSessionTerm = getSessionTermDescription(SessionTerm.ABNORMAL, 'dotnet');
  30. expect(abnormalSessionTerm).toEqual(mobileTermsDescription.abnormal);
  31. // Healthy
  32. const healthySessionTerm = getSessionTermDescription(SessionTerm.HEALTHY, 'dotnet');
  33. expect(healthySessionTerm).toEqual(mobileTermsDescription.healthy);
  34. // Errored
  35. const erroredSessionTerm = getSessionTermDescription(SessionTerm.ERRORED, 'dotnet');
  36. expect(erroredSessionTerm).toEqual(mobileTermsDescription.errored);
  37. // Unhandled
  38. const unhandledSessionTerm = getSessionTermDescription(
  39. SessionTerm.UNHANDLED,
  40. 'dotnet'
  41. );
  42. expect(unhandledSessionTerm).toEqual(mobileTermsDescription.unhandled);
  43. });
  44. it('java terms', function () {
  45. // Crashes
  46. const crashesSessionTerm = getSessionTermDescription(SessionTerm.CRASHES, 'java');
  47. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  48. // Crashed
  49. const crashedSessionTerm = getSessionTermDescription(SessionTerm.CRASHED, 'java');
  50. expect(crashedSessionTerm).toEqual(mobileTermsDescription.crashed);
  51. // Crash Free Users
  52. const crashFreeUsersSessionTerm = getSessionTermDescription(
  53. SessionTerm.CRASH_FREE_USERS,
  54. 'java'
  55. );
  56. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  57. // Crash Free Sessions
  58. const crashFreeSessionTerm = getSessionTermDescription(
  59. SessionTerm.CRASH_FREE_SESSIONS,
  60. 'java'
  61. );
  62. expect(crashFreeSessionTerm).toEqual(mobileTermsDescription['crash-free-sessions']);
  63. // Abnormal
  64. const abnormalSessionTerm = getSessionTermDescription(SessionTerm.ABNORMAL, 'java');
  65. expect(abnormalSessionTerm).toEqual(mobileTermsDescription.abnormal);
  66. // Healthy
  67. const healthySessionTerm = getSessionTermDescription(SessionTerm.HEALTHY, 'java');
  68. expect(healthySessionTerm).toEqual(mobileTermsDescription.healthy);
  69. // Errored
  70. const erroredSessionTerm = getSessionTermDescription(SessionTerm.ERRORED, 'java');
  71. expect(erroredSessionTerm).toEqual(mobileTermsDescription.errored);
  72. // Unhandled
  73. const unhandledSessionTerm = getSessionTermDescription(SessionTerm.UNHANDLED, 'java');
  74. expect(unhandledSessionTerm).toEqual(mobileTermsDescription.unhandled);
  75. });
  76. it('java-spring terms', function () {
  77. // Crashes
  78. const crashesSessionTerm = getSessionTermDescription(
  79. SessionTerm.CRASHES,
  80. 'java-spring'
  81. );
  82. expect(crashesSessionTerm).toEqual(
  83. 'A request that resulted in an unhandled exception and hence a Server Error response'
  84. );
  85. // Crashed
  86. const crashedSessionTerm = getSessionTermDescription(
  87. SessionTerm.CRASHED,
  88. 'java-spring'
  89. );
  90. expect(crashedSessionTerm).toEqual(mobileTermsDescription.crashed);
  91. // Crash Free Users
  92. const crashFreeUsersSessionTerm = getSessionTermDescription(
  93. SessionTerm.CRASH_FREE_USERS,
  94. 'java-spring'
  95. );
  96. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  97. // Crash Free Sessions
  98. const crashFreeSessionTerm = getSessionTermDescription(
  99. SessionTerm.CRASH_FREE_SESSIONS,
  100. 'java-spring'
  101. );
  102. expect(crashFreeSessionTerm).toEqual(mobileTermsDescription['crash-free-sessions']);
  103. // Abnormal
  104. const abnormalSessionTerm = getSessionTermDescription(
  105. SessionTerm.ABNORMAL,
  106. 'java-spring'
  107. );
  108. expect(abnormalSessionTerm).toEqual(mobileTermsDescription.abnormal);
  109. // Healthy
  110. const healthySessionTerm = getSessionTermDescription(
  111. SessionTerm.HEALTHY,
  112. 'java-spring'
  113. );
  114. expect(healthySessionTerm).toEqual(mobileTermsDescription.healthy);
  115. // Errored
  116. const erroredSessionTerm = getSessionTermDescription(
  117. SessionTerm.ERRORED,
  118. 'java-spring'
  119. );
  120. expect(erroredSessionTerm).toEqual(mobileTermsDescription.errored);
  121. // Unhandled
  122. const unhandledSessionTerm = getSessionTermDescription(
  123. SessionTerm.UNHANDLED,
  124. 'java-spring'
  125. );
  126. expect(unhandledSessionTerm).toEqual(mobileTermsDescription.unhandled);
  127. });
  128. it('dotnet-aspnetcore terms', function () {
  129. // Crashes
  130. const crashesSessionTerm = getSessionTermDescription(
  131. SessionTerm.CRASHES,
  132. 'dotnet-aspnetcore'
  133. );
  134. expect(crashesSessionTerm).toEqual(
  135. 'A request that resulted in an unhandled exception and hence a Server Error response'
  136. );
  137. // Crashed
  138. const crashedSessionTerm = getSessionTermDescription(
  139. SessionTerm.CRASHED,
  140. 'dotnet-aspnetcore'
  141. );
  142. expect(crashedSessionTerm).toEqual(mobileTermsDescription.crashed);
  143. // Crash Free Users
  144. const crashFreeUsersSessionTerm = getSessionTermDescription(
  145. SessionTerm.CRASH_FREE_USERS,
  146. 'dotnet-aspnetcore'
  147. );
  148. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  149. // Crash Free Sessions
  150. const crashFreeSessionTerm = getSessionTermDescription(
  151. SessionTerm.CRASH_FREE_SESSIONS,
  152. 'dotnet-aspnetcore'
  153. );
  154. expect(crashFreeSessionTerm).toEqual(mobileTermsDescription['crash-free-sessions']);
  155. // Abnormal
  156. const abnormalSessionTerm = getSessionTermDescription(
  157. SessionTerm.ABNORMAL,
  158. 'dotnet-aspnetcore'
  159. );
  160. expect(abnormalSessionTerm).toEqual(mobileTermsDescription.abnormal);
  161. // Healthy
  162. const healthySessionTerm = getSessionTermDescription(
  163. SessionTerm.HEALTHY,
  164. 'dotnet-aspnetcore'
  165. );
  166. expect(healthySessionTerm).toEqual(mobileTermsDescription.healthy);
  167. // Errored
  168. const erroredSessionTerm = getSessionTermDescription(
  169. SessionTerm.ERRORED,
  170. 'dotnet-aspnetcore'
  171. );
  172. expect(erroredSessionTerm).toEqual(mobileTermsDescription.errored);
  173. // Unhandled
  174. const unhandledSessionTerm = getSessionTermDescription(
  175. SessionTerm.UNHANDLED,
  176. 'dotnet-aspnetcore'
  177. );
  178. expect(unhandledSessionTerm).toEqual(mobileTermsDescription.unhandled);
  179. });
  180. it('android terms', function () {
  181. // Crashes
  182. const crashesSessionTerm = getSessionTermDescription(SessionTerm.CRASHES, 'android');
  183. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  184. // Crashed
  185. const crashedSessionTerm = getSessionTermDescription(SessionTerm.CRASHED, 'android');
  186. expect(crashedSessionTerm).toEqual(
  187. 'An unhandled exception that resulted in the application crashing'
  188. );
  189. // Crash Free Users
  190. const crashFreeUsersSessionTerm = getSessionTermDescription(
  191. SessionTerm.CRASH_FREE_USERS,
  192. 'android'
  193. );
  194. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  195. // Crash Free Sessions
  196. const crashFreeSessionTerm = getSessionTermDescription(
  197. SessionTerm.CRASH_FREE_SESSIONS,
  198. 'android'
  199. );
  200. expect(crashFreeSessionTerm).toEqual(mobileTermsDescription['crash-free-sessions']);
  201. // Abnormal
  202. const abnormalSessionTerm = getSessionTermDescription(
  203. SessionTerm.ABNORMAL,
  204. 'android'
  205. );
  206. expect(abnormalSessionTerm).toEqual(mobileTermsDescription.abnormal);
  207. // Healthy
  208. const healthySessionTerm = getSessionTermDescription(SessionTerm.HEALTHY, 'android');
  209. expect(healthySessionTerm).toEqual(mobileTermsDescription.healthy);
  210. // Errored
  211. const erroredSessionTerm = getSessionTermDescription(SessionTerm.ERRORED, 'android');
  212. expect(erroredSessionTerm).toEqual(mobileTermsDescription.errored);
  213. // Unhandled
  214. const unhandledSessionTerm = getSessionTermDescription(
  215. SessionTerm.UNHANDLED,
  216. 'android'
  217. );
  218. expect(unhandledSessionTerm).toEqual(mobileTermsDescription.unhandled);
  219. });
  220. it('cordova terms', function () {
  221. // Crashes
  222. const crashesSessionTerm = getSessionTermDescription(SessionTerm.CRASHES, 'cordova');
  223. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  224. // Crashed
  225. const crashedSessionTerm = getSessionTermDescription(SessionTerm.CRASHED, 'cordova');
  226. expect(crashedSessionTerm).toEqual(
  227. 'An unhandled exception that resulted in the application crashing'
  228. );
  229. // Crash Free Users
  230. const crashFreeUsersSessionTerm = getSessionTermDescription(
  231. SessionTerm.CRASH_FREE_USERS,
  232. 'cordova'
  233. );
  234. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  235. // Crash Free Sessions
  236. const crashFreeSessionTerm = getSessionTermDescription(
  237. SessionTerm.CRASH_FREE_SESSIONS,
  238. 'cordova'
  239. );
  240. expect(crashFreeSessionTerm).toEqual(mobileTermsDescription['crash-free-sessions']);
  241. // Abnormal
  242. const abnormalSessionTerm = getSessionTermDescription(
  243. SessionTerm.ABNORMAL,
  244. 'cordova'
  245. );
  246. expect(abnormalSessionTerm).toEqual(mobileTermsDescription.abnormal);
  247. // Healthy
  248. const healthySessionTerm = getSessionTermDescription(SessionTerm.HEALTHY, 'cordova');
  249. expect(healthySessionTerm).toEqual(mobileTermsDescription.healthy);
  250. // Errored
  251. const erroredSessionTerm = getSessionTermDescription(SessionTerm.ERRORED, 'cordova');
  252. expect(erroredSessionTerm).toEqual(mobileTermsDescription.errored);
  253. // Unhandled
  254. const unhandledSessionTerm = getSessionTermDescription(
  255. SessionTerm.UNHANDLED,
  256. 'cordova'
  257. );
  258. expect(unhandledSessionTerm).toEqual(mobileTermsDescription.unhandled);
  259. });
  260. it('react-native terms', function () {
  261. // Crashes
  262. const crashesSessionTerm = getSessionTermDescription(
  263. SessionTerm.CRASHES,
  264. 'react-native'
  265. );
  266. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  267. // Crashed
  268. const crashedSessionTerm = getSessionTermDescription(
  269. SessionTerm.CRASHED,
  270. 'react-native'
  271. );
  272. expect(crashedSessionTerm).toEqual(
  273. 'An unhandled exception that resulted in the application crashing'
  274. );
  275. // Crash Free Users
  276. const crashFreeUsersSessionTerm = getSessionTermDescription(
  277. SessionTerm.CRASH_FREE_USERS,
  278. 'react-native'
  279. );
  280. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  281. // Crash Free Sessions
  282. const crashFreeSessionTerm = getSessionTermDescription(
  283. SessionTerm.CRASH_FREE_SESSIONS,
  284. 'react-native'
  285. );
  286. expect(crashFreeSessionTerm).toEqual(mobileTermsDescription['crash-free-sessions']);
  287. // Abnormal
  288. const abnormalSessionTerm = getSessionTermDescription(
  289. SessionTerm.ABNORMAL,
  290. 'react-native'
  291. );
  292. expect(abnormalSessionTerm).toEqual(mobileTermsDescription.abnormal);
  293. // Healthy
  294. const healthySessionTerm = getSessionTermDescription(
  295. SessionTerm.HEALTHY,
  296. 'react-native'
  297. );
  298. expect(healthySessionTerm).toEqual(mobileTermsDescription.healthy);
  299. // Errored
  300. const erroredSessionTerm = getSessionTermDescription(
  301. SessionTerm.ERRORED,
  302. 'react-native'
  303. );
  304. expect(erroredSessionTerm).toEqual(mobileTermsDescription.errored);
  305. // Unhandled
  306. const unhandledSessionTerm = getSessionTermDescription(
  307. SessionTerm.UNHANDLED,
  308. 'react-native'
  309. );
  310. expect(unhandledSessionTerm).toEqual(mobileTermsDescription.unhandled);
  311. });
  312. it('flutter terms', function () {
  313. // Crashes
  314. const crashesSessionTerm = getSessionTermDescription(SessionTerm.CRASHES, 'flutter');
  315. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  316. // Crashed
  317. const crashedSessionTerm = getSessionTermDescription(SessionTerm.CRASHED, 'flutter');
  318. expect(crashedSessionTerm).toEqual(
  319. 'An unhandled exception that resulted in the application crashing'
  320. );
  321. // Crash Free Users
  322. const crashFreeUsersSessionTerm = getSessionTermDescription(
  323. SessionTerm.CRASH_FREE_USERS,
  324. 'flutter'
  325. );
  326. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  327. // Crash Free Sessions
  328. const crashFreeSessionTerm = getSessionTermDescription(
  329. SessionTerm.CRASH_FREE_SESSIONS,
  330. 'flutter'
  331. );
  332. expect(crashFreeSessionTerm).toEqual(mobileTermsDescription['crash-free-sessions']);
  333. // Abnormal
  334. const abnormalSessionTerm = getSessionTermDescription(
  335. SessionTerm.ABNORMAL,
  336. 'flutter'
  337. );
  338. expect(abnormalSessionTerm).toEqual(mobileTermsDescription.abnormal);
  339. // Healthy
  340. const healthySessionTerm = getSessionTermDescription(SessionTerm.HEALTHY, 'flutter');
  341. expect(healthySessionTerm).toEqual(mobileTermsDescription.healthy);
  342. // Errored
  343. const erroredSessionTerm = getSessionTermDescription(SessionTerm.ERRORED, 'flutter');
  344. expect(erroredSessionTerm).toEqual(mobileTermsDescription.errored);
  345. // Unhandled
  346. const unhandledSessionTerm = getSessionTermDescription(
  347. SessionTerm.UNHANDLED,
  348. 'flutter'
  349. );
  350. expect(unhandledSessionTerm).toEqual(mobileTermsDescription.unhandled);
  351. });
  352. it('apple terms', function () {
  353. // Crashes
  354. const crashesSessionTerm = getSessionTermDescription(
  355. SessionTerm.CRASHES,
  356. 'apple-macos'
  357. );
  358. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  359. // Crashed
  360. const crashedSessionTerm = getSessionTermDescription(
  361. SessionTerm.CRASHED,
  362. 'apple-macos'
  363. );
  364. expect(crashedSessionTerm).toEqual(
  365. 'An error that resulted in the application crashing'
  366. );
  367. // Crash Free Users
  368. const crashFreeUsersSessionTerm = getSessionTermDescription(
  369. SessionTerm.CRASH_FREE_USERS,
  370. 'apple-macos'
  371. );
  372. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  373. // Crash Free Sessions
  374. const crashFreeSessionTerm = getSessionTermDescription(
  375. SessionTerm.CRASH_FREE_SESSIONS,
  376. 'apple-macos'
  377. );
  378. expect(crashFreeSessionTerm).toEqual(mobileTermsDescription['crash-free-sessions']);
  379. // Abnormal
  380. const abnormalSessionTerm = getSessionTermDescription(
  381. SessionTerm.ABNORMAL,
  382. 'apple-macos'
  383. );
  384. expect(abnormalSessionTerm).toEqual(mobileTermsDescription.abnormal);
  385. // Healthy
  386. const healthySessionTerm = getSessionTermDescription(
  387. SessionTerm.HEALTHY,
  388. 'apple-macos'
  389. );
  390. expect(healthySessionTerm).toEqual(mobileTermsDescription.healthy);
  391. // Errored
  392. const erroredSessionTerm = getSessionTermDescription(
  393. SessionTerm.ERRORED,
  394. 'apple-macos'
  395. );
  396. expect(erroredSessionTerm).toEqual(mobileTermsDescription.errored);
  397. // Unhandled
  398. const unhandledSessionTerm = getSessionTermDescription(
  399. SessionTerm.UNHANDLED,
  400. 'apple-macos'
  401. );
  402. expect(unhandledSessionTerm).toEqual(mobileTermsDescription.unhandled);
  403. });
  404. it('node-express terms', function () {
  405. // Crashes
  406. const crashesSessionTerm = getSessionTermDescription(
  407. SessionTerm.CRASHES,
  408. 'node-express'
  409. );
  410. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  411. // Crashed
  412. const crashedSessionTerm = getSessionTermDescription(
  413. SessionTerm.CRASHED,
  414. 'node-express'
  415. );
  416. expect(crashedSessionTerm).toEqual(
  417. 'During the session an unhandled global error/promise rejection occurred.'
  418. );
  419. // Crash Free Users
  420. const crashFreeUsersSessionTerm = getSessionTermDescription(
  421. SessionTerm.CRASH_FREE_USERS,
  422. 'node-express'
  423. );
  424. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  425. // Crash Free Sessions
  426. const crashFreeSessionTerm = getSessionTermDescription(
  427. SessionTerm.CRASH_FREE_SESSIONS,
  428. 'node-express'
  429. );
  430. expect(crashFreeSessionTerm).toEqual(commonTermsDescription['crash-free-sessions']);
  431. // Abnormal
  432. const abnormalSessionTerm = getSessionTermDescription(
  433. SessionTerm.ABNORMAL,
  434. 'node-express'
  435. );
  436. expect(abnormalSessionTerm).toEqual('Non applicable for Javascript.');
  437. // Healthy
  438. const healthySessionTerm = getSessionTermDescription(
  439. SessionTerm.HEALTHY,
  440. 'node-express'
  441. );
  442. expect(healthySessionTerm).toEqual(
  443. 'No errors were captured during session life-time.'
  444. );
  445. // Errored
  446. const erroredSessionTerm = getSessionTermDescription(
  447. SessionTerm.ERRORED,
  448. 'node-express'
  449. );
  450. expect(erroredSessionTerm).toEqual(
  451. 'During the session at least one handled error occurred.'
  452. );
  453. // Unhandled
  454. const unhandledSessionTerm = getSessionTermDescription(
  455. SessionTerm.UNHANDLED,
  456. 'node-express'
  457. );
  458. expect(unhandledSessionTerm).toEqual(
  459. "An error was captured by the global 'onerror' or 'onunhandledrejection' handler."
  460. );
  461. });
  462. it('javascript terms', function () {
  463. // Crashes
  464. const crashesSessionTerm = getSessionTermDescription(
  465. SessionTerm.CRASHES,
  466. 'javascript'
  467. );
  468. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  469. // Crashed
  470. const crashedSessionTerm = getSessionTermDescription(
  471. SessionTerm.CRASHED,
  472. 'javascript'
  473. );
  474. expect(crashedSessionTerm).toEqual(
  475. 'During the session an unhandled global error/promise rejection occurred.'
  476. );
  477. // Crash Free Users
  478. const crashFreeUsersSessionTerm = getSessionTermDescription(
  479. SessionTerm.CRASH_FREE_USERS,
  480. 'javascript'
  481. );
  482. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  483. // Crash Free Sessions
  484. const crashFreeSessionTerm = getSessionTermDescription(
  485. SessionTerm.CRASH_FREE_SESSIONS,
  486. 'javascript'
  487. );
  488. expect(crashFreeSessionTerm).toEqual(commonTermsDescription['crash-free-sessions']);
  489. // Abnormal
  490. const abnormalSessionTerm = getSessionTermDescription(
  491. SessionTerm.ABNORMAL,
  492. 'javascript'
  493. );
  494. expect(abnormalSessionTerm).toEqual('Non applicable for Javascript.');
  495. // Healthy
  496. const healthySessionTerm = getSessionTermDescription(
  497. SessionTerm.HEALTHY,
  498. 'javascript'
  499. );
  500. expect(healthySessionTerm).toEqual(
  501. 'No errors were captured during session life-time.'
  502. );
  503. // Errored
  504. const erroredSessionTerm = getSessionTermDescription(
  505. SessionTerm.ERRORED,
  506. 'javascript'
  507. );
  508. expect(erroredSessionTerm).toEqual(
  509. 'During the session at least one handled error occurred.'
  510. );
  511. // Unhandled
  512. const unhandledSessionTerm = getSessionTermDescription(
  513. SessionTerm.UNHANDLED,
  514. 'javascript'
  515. );
  516. expect(unhandledSessionTerm).toEqual(
  517. "An error was captured by the global 'onerror' or 'onunhandledrejection' handler."
  518. );
  519. });
  520. it('rust terms', function () {
  521. // Crashes
  522. const crashesSessionTerm = getSessionTermDescription(SessionTerm.CRASHES, 'rust');
  523. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  524. // Crashed
  525. const crashedSessionTerm = getSessionTermDescription(SessionTerm.CRASHED, 'rust');
  526. expect(crashedSessionTerm).toEqual(
  527. 'The application had an unrecoverable error (a panic)'
  528. );
  529. // Crash Free Users
  530. const crashFreeUsersSessionTerm = getSessionTermDescription(
  531. SessionTerm.CRASH_FREE_USERS,
  532. 'rust'
  533. );
  534. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  535. // Crash Free Sessions
  536. const crashFreeSessionTerm = getSessionTermDescription(
  537. SessionTerm.CRASH_FREE_SESSIONS,
  538. 'rust'
  539. );
  540. expect(crashFreeSessionTerm).toEqual(commonTermsDescription['crash-free-sessions']);
  541. // Abnormal
  542. const abnormalSessionTerm = getSessionTermDescription(SessionTerm.ABNORMAL, 'rust');
  543. expect(abnormalSessionTerm).toEqual(desktopTermDescriptions.abnormal);
  544. // Healthy
  545. const healthySessionTerm = getSessionTermDescription(SessionTerm.HEALTHY, 'rust');
  546. expect(healthySessionTerm).toEqual(desktopTermDescriptions.healthy);
  547. // Errored
  548. const erroredSessionTerm = getSessionTermDescription(SessionTerm.ERRORED, 'rust');
  549. expect(erroredSessionTerm).toEqual(desktopTermDescriptions.errored);
  550. // Unhandled
  551. const unhandledSessionTerm = getSessionTermDescription(SessionTerm.UNHANDLED, 'rust');
  552. expect(unhandledSessionTerm).toEqual(desktopTermDescriptions.unhandled);
  553. });
  554. it('apple-ios terms', function () {
  555. // Crashes
  556. const crashesSessionTerm = getSessionTermDescription(
  557. SessionTerm.CRASHES,
  558. 'apple-ios'
  559. );
  560. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  561. // Crashed
  562. const crashedSessionTerm = getSessionTermDescription(
  563. SessionTerm.CRASHED,
  564. 'apple-ios'
  565. );
  566. expect(crashedSessionTerm).toEqual(desktopTermDescriptions.crashed);
  567. // Crash Free Users
  568. const crashFreeUsersSessionTerm = getSessionTermDescription(
  569. SessionTerm.CRASH_FREE_USERS,
  570. 'apple-ios'
  571. );
  572. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  573. // Crash Free Sessions
  574. const crashFreeSessionTerm = getSessionTermDescription(
  575. SessionTerm.CRASH_FREE_SESSIONS,
  576. 'apple-ios'
  577. );
  578. expect(crashFreeSessionTerm).toEqual(commonTermsDescription['crash-free-sessions']);
  579. // Abnormal
  580. const abnormalSessionTerm = getSessionTermDescription(
  581. SessionTerm.ABNORMAL,
  582. 'apple-ios'
  583. );
  584. expect(abnormalSessionTerm).toEqual(desktopTermDescriptions.abnormal);
  585. // Healthy
  586. const healthySessionTerm = getSessionTermDescription(
  587. SessionTerm.HEALTHY,
  588. 'apple-ios'
  589. );
  590. expect(healthySessionTerm).toEqual(desktopTermDescriptions.healthy);
  591. // Errored
  592. const erroredSessionTerm = getSessionTermDescription(
  593. SessionTerm.ERRORED,
  594. 'apple-ios'
  595. );
  596. expect(erroredSessionTerm).toEqual(desktopTermDescriptions.errored);
  597. // Unhandled
  598. const unhandledSessionTerm = getSessionTermDescription(
  599. SessionTerm.UNHANDLED,
  600. 'apple-ios'
  601. );
  602. expect(unhandledSessionTerm).toEqual(desktopTermDescriptions.unhandled);
  603. });
  604. it('minidump terms', function () {
  605. // Crashes
  606. const crashesSessionTerm = getSessionTermDescription(SessionTerm.CRASHES, 'minidump');
  607. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  608. // Crashed
  609. const crashedSessionTerm = getSessionTermDescription(SessionTerm.CRASHED, 'minidump');
  610. expect(crashedSessionTerm).toEqual(desktopTermDescriptions.crashed);
  611. // Crash Free Users
  612. const crashFreeUsersSessionTerm = getSessionTermDescription(
  613. SessionTerm.CRASH_FREE_USERS,
  614. 'minidump'
  615. );
  616. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  617. // Crash Free Sessions
  618. const crashFreeSessionTerm = getSessionTermDescription(
  619. SessionTerm.CRASH_FREE_SESSIONS,
  620. 'minidump'
  621. );
  622. expect(crashFreeSessionTerm).toEqual(commonTermsDescription['crash-free-sessions']);
  623. // Abnormal
  624. const abnormalSessionTerm = getSessionTermDescription(
  625. SessionTerm.ABNORMAL,
  626. 'minidump'
  627. );
  628. expect(abnormalSessionTerm).toEqual(desktopTermDescriptions.abnormal);
  629. // Healthy
  630. const healthySessionTerm = getSessionTermDescription(SessionTerm.HEALTHY, 'minidump');
  631. expect(healthySessionTerm).toEqual(desktopTermDescriptions.healthy);
  632. // Errored
  633. const erroredSessionTerm = getSessionTermDescription(SessionTerm.ERRORED, 'minidump');
  634. expect(erroredSessionTerm).toEqual(desktopTermDescriptions.errored);
  635. // Unhandled
  636. const unhandledSessionTerm = getSessionTermDescription(
  637. SessionTerm.UNHANDLED,
  638. 'minidump'
  639. );
  640. expect(unhandledSessionTerm).toEqual(desktopTermDescriptions.unhandled);
  641. });
  642. it('native terms', function () {
  643. // Crashes
  644. const crashesSessionTerm = getSessionTermDescription(SessionTerm.CRASHES, 'native');
  645. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  646. // Crashed
  647. const crashedSessionTerm = getSessionTermDescription(SessionTerm.CRASHED, 'native');
  648. expect(crashedSessionTerm).toEqual(desktopTermDescriptions.crashed);
  649. // Crash Free Users
  650. const crashFreeUsersSessionTerm = getSessionTermDescription(
  651. SessionTerm.CRASH_FREE_USERS,
  652. 'native'
  653. );
  654. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  655. // Crash Free Sessions
  656. const crashFreeSessionTerm = getSessionTermDescription(
  657. SessionTerm.CRASH_FREE_SESSIONS,
  658. 'native'
  659. );
  660. expect(crashFreeSessionTerm).toEqual(commonTermsDescription['crash-free-sessions']);
  661. // Abnormal
  662. const abnormalSessionTerm = getSessionTermDescription(SessionTerm.ABNORMAL, 'native');
  663. expect(abnormalSessionTerm).toEqual(desktopTermDescriptions.abnormal);
  664. // Healthy
  665. const healthySessionTerm = getSessionTermDescription(SessionTerm.HEALTHY, 'native');
  666. expect(healthySessionTerm).toEqual(desktopTermDescriptions.healthy);
  667. // Errored
  668. const erroredSessionTerm = getSessionTermDescription(SessionTerm.ERRORED, 'native');
  669. expect(erroredSessionTerm).toEqual(desktopTermDescriptions.errored);
  670. // Unhandled
  671. const unhandledSessionTerm = getSessionTermDescription(
  672. SessionTerm.UNHANDLED,
  673. 'native'
  674. );
  675. expect(unhandledSessionTerm).toEqual(desktopTermDescriptions.unhandled);
  676. });
  677. it('python terms', function () {
  678. // Crashes
  679. const crashesSessionTerm = getSessionTermDescription(SessionTerm.CRASHES, 'python');
  680. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  681. // Crashed
  682. const crashedSessionTerm = getSessionTermDescription(SessionTerm.CRASHED, 'python');
  683. expect(crashedSessionTerm).toEqual(
  684. 'Number of users who experienced an unhandled error'
  685. );
  686. // Crash Free Users
  687. const crashFreeUsersSessionTerm = getSessionTermDescription(
  688. SessionTerm.CRASH_FREE_USERS,
  689. 'python'
  690. );
  691. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  692. // Crash Free Sessions
  693. const crashFreeSessionTerm = getSessionTermDescription(
  694. SessionTerm.CRASH_FREE_SESSIONS,
  695. 'python'
  696. );
  697. expect(crashFreeSessionTerm).toEqual(commonTermsDescription['crash-free-sessions']);
  698. // Abnormal
  699. const abnormalSessionTerm = getSessionTermDescription(SessionTerm.ABNORMAL, 'python');
  700. expect(abnormalSessionTerm).toEqual('An unknown session exit');
  701. // Healthy
  702. const healthySessionTerm = getSessionTermDescription(SessionTerm.HEALTHY, 'python');
  703. expect(healthySessionTerm).toEqual(mobileTermsDescription.healthy);
  704. // Errored
  705. const erroredSessionTerm = getSessionTermDescription(SessionTerm.ERRORED, 'python');
  706. expect(erroredSessionTerm).toEqual(mobileTermsDescription.errored);
  707. // Unhandled
  708. const unhandledSessionTerm = getSessionTermDescription(
  709. SessionTerm.UNHANDLED,
  710. 'python'
  711. );
  712. expect(unhandledSessionTerm).toEqual(mobileTermsDescription.unhandled);
  713. });
  714. it('default terms', function () {
  715. // Crashes
  716. const crashesSessionTerm = getSessionTermDescription(SessionTerm.CRASHES, null);
  717. expect(crashesSessionTerm).toEqual(commonTermsDescription.crashes);
  718. // Crashed
  719. const crashedSessionTerm = getSessionTermDescription(SessionTerm.CRASHED, null);
  720. expect(crashedSessionTerm).toEqual(
  721. 'Number of users who experienced an unhandled error'
  722. );
  723. // Crash Free Users
  724. const crashFreeUsersSessionTerm = getSessionTermDescription(
  725. SessionTerm.CRASH_FREE_USERS,
  726. null
  727. );
  728. expect(crashFreeUsersSessionTerm).toEqual(commonTermsDescription['crash-free-users']);
  729. // Crash Free Sessions
  730. const crashFreeSessionTerm = getSessionTermDescription(
  731. SessionTerm.CRASH_FREE_SESSIONS,
  732. null
  733. );
  734. expect(crashFreeSessionTerm).toEqual(commonTermsDescription['crash-free-sessions']);
  735. // Abnormal
  736. const abnormalSessionTerm = getSessionTermDescription(SessionTerm.ABNORMAL, null);
  737. expect(abnormalSessionTerm).toEqual('An unknown session exit');
  738. // Healthy
  739. const healthySessionTerm = getSessionTermDescription(SessionTerm.HEALTHY, null);
  740. expect(healthySessionTerm).toEqual(mobileTermsDescription.healthy);
  741. // Errored
  742. const erroredSessionTerm = getSessionTermDescription(SessionTerm.ERRORED, null);
  743. expect(erroredSessionTerm).toEqual(mobileTermsDescription.errored);
  744. // Unhandled
  745. const unhandledSessionTerm = getSessionTermDescription(SessionTerm.UNHANDLED, null);
  746. expect(unhandledSessionTerm).toEqual(mobileTermsDescription.unhandled);
  747. });
  748. });