Skip to content

Commit

Permalink
relative_options converted to TS
Browse files Browse the repository at this point in the history
  • Loading branch information
Theo committed May 7, 2019
1 parent d332537 commit 0b77d3a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { relativeUnitsFromLargestToSmallest } from './relative_options';

describe('relativeUnitsFromLargestToSmallest', () => {
test('relativeUnitsFromLargestToSmallest length', () => {
expect(relativeUnitsFromLargestToSmallest.length).toBe(7);
});
test('relativeUnitsFromLargestToSmallest order', () => {
expect(relativeUnitsFromLargestToSmallest).toEqual([
'y',
'M',
'w',
'd',
'h',
'm',
's',
]);
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
interface RelativeOption {
text: string;
value: string;
}

export const relativeOptions = [
export const relativeOptions: RelativeOption[] = [
{ text: 'Seconds ago', value: 's' },
{ text: 'Minutes ago', value: 'm' },
{ text: 'Hours ago', value: 'h' },
Expand Down

0 comments on commit 0b77d3a

Please sign in to comment.