15 lines
391 B
JavaScript
15 lines
391 B
JavaScript
import { chineseShortTimestamp } from '../TimeAgo.vue';
|
|
|
|
describe('chineseShortTimestamp', () => {
|
|
it.each([
|
|
['now', '刚刚'],
|
|
['1m', '1分钟'],
|
|
['1h', '1小时'],
|
|
['12h', '12小时'],
|
|
['1d', '1天'],
|
|
['2mo', '2个月'],
|
|
['1y', '1年'],
|
|
])('formats %s as %s', (timestamp, expected) => {
|
|
expect(chineseShortTimestamp(timestamp)).toBe(expected);
|
|
});
|
|
}); |