Skip to content

Commit

Permalink
Add tests for moment.d.ts
Browse files Browse the repository at this point in the history
as discussed in moment#3280
  • Loading branch information
johnnyreilly authored and ichernev committed Sep 7, 2016
1 parent b9a59ea commit 24f0e20
Show file tree
Hide file tree
Showing 4 changed files with 500 additions and 1 deletion.
7 changes: 7 additions & 0 deletions moment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,23 @@ declare namespace moment {
meridiem?: (hour: number, minute: number, isLowercase: boolean) => string;
calendar?: MomentCalendar;
ordinal?: (num: number) => string;
week?: MomentLanguageWeek;
}

interface MomentLanguage extends BaseMomentLanguage {
longDateFormat?: MomentLongDateFormat;
}

interface MomentLanguageWeek {
dow?: number;
doy?: number;
}

type UnitOfTime = ("year" | "years" | "y" |
"quarter" | "quarters" | "Q" |
"month" | "months" | "M" |
"week" | "weeks" | "w" |
"date" |
"day" | "days" | "d" |
"hour" | "hours" | "h" |
"minute" | "minutes" | "m" |
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
}
},
"scripts": {
"test": "grunt test",
"test-typings": "tsc --project typing-tests",
"test": "grunt test && npm run test-typings",
"coverage": "nyc npm test && nyc report",
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
},
Expand Down
Loading

0 comments on commit 24f0e20

Please sign in to comment.