@@ -10,6 +10,8 @@ import {I18nFormatter} from '../../renderer/i18n-formatter.js';
10
10
11
11
const NBSP = '\xa0' ;
12
12
13
+ const [ nodeMajor , nodeMinor ] = process . version . replace ( 'v' , '' ) . split ( '.' ) . map ( Number ) ;
14
+
13
15
describe ( 'i18n formatter' , ( ) => {
14
16
it ( 'formats a number' , ( ) => {
15
17
const i18n = new I18nFormatter ( 'en' ) ;
@@ -139,9 +141,16 @@ describe('i18n formatter', () => {
139
141
// Yes, this is actually backwards (s h d).
140
142
i18n = new I18nFormatter ( 'ar' ) ;
141
143
/* eslint-disable no-irregular-whitespace */
142
- assert . equal ( i18n . formatDuration ( 60 * 1000 ) , `١${ NBSP } د` ) ;
143
- assert . equal ( i18n . formatDuration ( 60 * 60 * 1000 + 5000 ) , `١${ NBSP } س ٥${ NBSP } ث` ) ;
144
- assert . equal ( i18n . formatDuration ( 28 * 60 * 60 * 1000 + 5000 ) , `١ ي ٤ س ٥ ث` ) ;
144
+ if ( nodeMajor >= 20 && nodeMinor >= 19 ) {
145
+ assert . equal ( i18n . formatDuration ( 60 * 1000 ) , `1${ NBSP } د` ) ;
146
+ assert . equal ( i18n . formatDuration ( 60 * 60 * 1000 + 5000 ) , `1${ NBSP } س 5${ NBSP } ث` ) ;
147
+ assert . equal ( i18n . formatDuration ( 28 * 60 * 60 * 1000 + 5000 ) , `1 ي 4 س 5 ث` ) ;
148
+ } else {
149
+ assert . equal ( i18n . formatDuration ( 60 * 1000 ) , `١${ NBSP } د` ) ;
150
+ assert . equal ( i18n . formatDuration ( 60 * 60 * 1000 + 5000 ) , `١${ NBSP } س ٥${ NBSP } ث` ) ;
151
+ assert . equal ( i18n . formatDuration ( 28 * 60 * 60 * 1000 + 5000 ) , `١ ي ٤ س ٥ ث` ) ;
152
+ }
153
+
145
154
/* eslint-enable no-irregular-whitespace */
146
155
} ) ;
147
156
0 commit comments