Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions test/StringField_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,8 @@ describe("StringField", () => {
);

expect(lengths).eql([
121 + 1, // from 1900 to 2020 + undefined
// from 1900 to current year + 2 (inclusive) + 1 undefined option
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nitpick - but would it make sense to extract a function that provides this, to avoid duplication between tests ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is imo not really necessary, in tests duplication is not so bad.

new Date().getFullYear() - 1900 + 3 + 1,
12 + 1,
31 + 1,
24 + 1,
Expand Down Expand Up @@ -1019,7 +1020,8 @@ describe("StringField", () => {
);

expect(lengths).eql([
121 + 1, // from 1900 to 2020 + undefined
// from 1900 to current year + 2 (inclusive) + 1 undefined option
new Date().getFullYear() - 1900 + 3 + 1,
12 + 1,
31 + 1,
]);
Expand Down