This repository was archived by the owner on Apr 14, 2021. It is now read-only.
Commit e1b81ae 1 parent 41ada9e commit e1b81ae Copy full SHA for e1b81ae
File tree 2 files changed +26
-2
lines changed
2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " intl" ,
3
- "version" : " 1.2.1 " ,
3
+ "version" : " 1.2.2 " ,
4
4
"description" : " Polyfill the ECMA-402 Intl API (except collation)" ,
5
5
"main" : " index.js" ,
6
6
"directories" : {
72
72
"build:dist" : " npm run build:dist:dev && npm run build:dist:prod" ,
73
73
"build" : " npm run build:data && npm run build:lib && npm run build:dist" ,
74
74
"lint" : " eslint ." ,
75
- "test" : " cd tests && node noderunner.js && node saucelabs.js" ,
75
+ "test" : " cd tests && node sanity.js && node noderunner.js && node saucelabs.js" ,
76
76
"pretest" : " npm run lint" ,
77
77
"preversion" : " npm run clean && npm run build && npm run test" ,
78
78
"prepublish" : " npm run clean && npm run build"
Original file line number Diff line number Diff line change
1
+ var IntlPolyfill = require ( '../' ) ;
2
+
3
+ function assert ( value , expected ) {
4
+ if ( value !== expected ) {
5
+ console . log ( 'expected value ' + expected + ' but the actual value is ' + value ) ;
6
+ process . exit ( 1 ) ;
7
+ }
8
+ }
9
+
10
+ assert ( new IntlPolyfill . NumberFormat ( 'de-DE' , {
11
+ minimumFractionDigits : 2 ,
12
+ maximumFractionDigits : 2
13
+ } ) . format ( 0.015 ) , "0,02" ) ;
14
+
15
+ assert ( new IntlPolyfill . NumberFormat ( 'en-US' , {
16
+ style : 'currency' ,
17
+ currency : 'GBP' ,
18
+ minimumFractionDigits : 2 ,
19
+ } ) . format ( 59.88 ) , '£59.88' ) ;
20
+
21
+ assert ( new IntlPolyfill . DateTimeFormat ( 'en' , {
22
+ month :'numeric' ,
23
+ day : 'numeric'
24
+ } ) . format ( new Date ( '2016/05/16' ) ) , '5/16' ) ;
You can’t perform that action at this time.
0 commit comments