spec/js/numbers/decimal.spec.js in twitter_cldr_js-2.4.0 vs spec/js/numbers/decimal.spec.js in twitter_cldr_js-3.1.0
- old
+ new
@@ -1,12 +1,15 @@
// Copyright 2012 Twitter, Inc
// http://www.apache.org/licenses/LICENSE-2.0
-var TwitterCldr = require('../../../lib/assets/javascripts/twitter_cldr/en.js');
+var TwitterCldr = require('../../../lib/assets/javascripts/twitter_cldr/core.js');
+var data = require('../../../lib/assets/javascripts/twitter_cldr/en.js');
describe("DecimalFormatter", function() {
+ var formatter;
beforeEach(function() {
+ TwitterCldr.set_data(data);
formatter = new TwitterCldr.DecimalFormatter();
});
describe("#format", function() {
it("should format positive decimals correctly", function() {
@@ -22,7 +25,11 @@
});
it("should allow a precision of zero", function() {
expect(formatter.format(12.3, {precision: 0})).toEqual("12");
});
+
+ it("should format big numbers correctly", function() {
+ expect(formatter.format(1234567)).toEqual("1,234,567");
+ });
});
-});
\ No newline at end of file
+});