generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #358 from github/payload-updates
Deployment Payload Updates
- Loading branch information
Showing
9 changed files
with
154 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {timestamp} from '../../src/functions/timestamp' | ||
|
||
beforeEach(() => { | ||
jest.clearAllMocks() | ||
}) | ||
|
||
describe('timestamp', () => { | ||
it('should return the current date in ISO 8601 format', () => { | ||
const mockDate = new Date('2025-01-01T00:00:00.000Z') | ||
jest.spyOn(global, 'Date').mockImplementation(() => mockDate) | ||
|
||
const result = timestamp() | ||
|
||
expect(result).toBe(mockDate.toISOString()) | ||
|
||
// Restore the original Date implementation | ||
global.Date.mockRestore() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Helper function to generate an ISO 8601 formatted timestamp string | ||
// :returns: An ISO 8601 formatted timestamp string (ex: 2025-01-01T00:00:00.000Z) | ||
export function timestamp() { | ||
const now = new Date() | ||
return now.toISOString() | ||
} |
Oops, something went wrong.