Skip to content

Test cases of date.util.spec.ts fixed#1947

Merged
tdonohue merged 2 commits intoDSpace:mainfrom
4Science:CST-7376
Nov 3, 2022
Merged

Test cases of date.util.spec.ts fixed#1947
tdonohue merged 2 commits intoDSpace:mainfrom
4Science:CST-7376

Conversation

@davide-negretti
Copy link
Copy Markdown
Contributor

@davide-negretti davide-negretti commented Nov 3, 2022

References

Description

Some unit tests were failing when the timezone of the OS had a positive UTC/GMT offset. This has been fixed by using UTC date format as input for the tested methods:

// const date = new Date(2022, 5, 3);
const date = new Date(Date.UTC(2022, 5, 3));

Instructions for Reviewers

If you live in a region where the UTC/GMT offset is negative, then change the time zone of your OS so that the UTC/GMT offset is positive (e.g. Europe Central Time, GMT+0100). You can check the offset on your browser's console:

console.log(new Date())

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes TSLint validation using yarn run lint
  • My PR doesn't introduce circular dependencies
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • If my PR includes new, third-party dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.

@tdonohue tdonohue added bug 1 APPROVAL pull request only requires a single approval to merge testing framework Related specifically to Unit or Integration (e2e) Tests labels Nov 3, 2022
@tdonohue tdonohue added this to the 7.5 milestone Nov 3, 2022
@tdonohue tdonohue self-requested a review November 3, 2022 19:17
Copy link
Copy Markdown
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

👍 Thanks @davide-negretti and @atarix83 . This looks good and makes sense to me.

@tdonohue tdonohue merged commit 94d38ef into DSpace:main Nov 3, 2022
@abollini abollini deleted the CST-7376 branch February 16, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge bug testing framework Related specifically to Unit or Integration (e2e) Tests

Projects

No open projects
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

need to fix test cases of date.util.spec.ts

3 participants