|
1 | | -import { jpNumerals, Numeral, NumeralZero } from '../src/jp-numerals' |
| 1 | +import { numerals, Numeral, NumeralZero } from '../src/jp-numerals' |
2 | 2 | import { JpNumeralUnit } from '../src/type' |
3 | 3 |
|
4 | 4 | describe('Numeral Class', () => { |
@@ -54,7 +54,7 @@ describe('class NumeralZero', () => { |
54 | 54 |
|
55 | 55 | describe('jpNumerals', () => { |
56 | 56 | it('can handle integer', () => { |
57 | | - const n = jpNumerals(12_3456_7890) |
| 57 | + const n = numerals(12_3456_7890) |
58 | 58 | expect(n.toTuples()).toEqual([[12, '億'], [3456, '万'], [7890, '']]) |
59 | 59 |
|
60 | 60 | expect(n.toNumerals()).toEqual([ |
@@ -89,17 +89,17 @@ describe('jpNumerals', () => { |
89 | 89 | }) |
90 | 90 |
|
91 | 91 | it('can handle float', () => { |
92 | | - const n = jpNumerals(12_3456_7890.123) |
| 92 | + const n = numerals(12_3456_7890.123) |
93 | 93 | expect(n.toTuples()).toEqual([[12, '億'], [3456, '万'], [7890.123, '']]) |
94 | 94 | }) |
95 | 95 |
|
96 | 96 | it('throw error if number is negative', () => { |
97 | | - expect(() => jpNumerals(-12_3456_7890.123)).toThrow() |
| 97 | + expect(() => numerals(-12_3456_7890.123)).toThrow() |
98 | 98 | }) |
99 | 99 |
|
100 | 100 | it('can use base as option', () => { |
101 | | - const n_base = jpNumerals(12_3456, JpNumeralUnit.万) |
102 | | - const n = jpNumerals(12_3456_0000) |
| 101 | + const n_base = numerals(12_3456, JpNumeralUnit.万) |
| 102 | + const n = numerals(12_3456_0000) |
103 | 103 |
|
104 | 104 | expect(n_base.toTuples()).toEqual(n.toTuples()) |
105 | 105 | expect(n_base.toNumerals()).toEqual(n.toNumerals()) |
|
0 commit comments