{"id":18881152,"url":"https://github.com/godogx/clocksteps","last_synced_at":"2025-09-10T23:37:20.137Z","repository":{"id":38187139,"uuid":"404266356","full_name":"godogx/clocksteps","owner":"godogx","description":"Cucumber Clock steps for Golang","archived":false,"fork":false,"pushed_at":"2025-09-04T06:03:16.000Z","size":72,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-04T08:24:29.848Z","etag":null,"topics":["bdd","clock","cucumber","functional-testing","gherkin","go","go-clock","godog","godog-extension","golang","integration-testing","testing","time"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/godogx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-08T08:16:51.000Z","updated_at":"2025-09-04T06:02:04.000Z","dependencies_parsed_at":"2024-11-08T06:47:48.030Z","dependency_job_id":"eb949db2-a3e8-4eeb-9e3b-d1d703da2423","html_url":"https://github.com/godogx/clocksteps","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/godogx/clocksteps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godogx%2Fclocksteps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godogx%2Fclocksteps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godogx%2Fclocksteps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godogx%2Fclocksteps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/godogx","download_url":"https://codeload.github.com/godogx/clocksteps/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godogx%2Fclocksteps/sbom","scorecard":{"id":433508,"data":{"date":"2025-08-11","repo":{"name":"github.com/godogx/clocksteps","commit":"5dabf09c33d7086ae981ed39cd342531c934188c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Code-Review","score":1,"reason":"Found 1/7 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/lint.yaml:1","Warn: no topLevel permission defined: .github/workflows/test.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/godogx/clocksteps/lint.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/godogx/clocksteps/lint.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yaml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/godogx/clocksteps/lint.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yaml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/godogx/clocksteps/lint.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/godogx/clocksteps/test.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/godogx/clocksteps/test.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/godogx/clocksteps/test.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yaml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/godogx/clocksteps/test.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yaml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/godogx/clocksteps/test.yaml/master?enable=pin","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T03:59:00.174Z","repository_id":38187139,"created_at":"2025-08-19T03:59:00.178Z","updated_at":"2025-08-19T03:59:00.178Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274547595,"owners_count":25305951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bdd","clock","cucumber","functional-testing","gherkin","go","go-clock","godog","godog-extension","golang","integration-testing","testing","time"],"created_at":"2024-11-08T06:47:43.529Z","updated_at":"2025-09-10T23:37:20.127Z","avatar_url":"https://github.com/godogx.png","language":"Go","readme":"# Cucumber Clock steps for Golang\n\n[![GitHub Releases](https://img.shields.io/github/v/release/godogx/clocksteps)](https://github.com/godogx/clocksteps/releases/latest)\n[![Build Status](https://github.com/godogx/clocksteps/actions/workflows/test.yaml/badge.svg)](https://github.com/godogx/clocksteps/actions/workflows/test.yaml)\n[![codecov](https://codecov.io/gh/godogx/clocksteps/branch/master/graph/badge.svg?token=eTdAgDE2vR)](https://codecov.io/gh/godogx/clocksteps)\n[![Go Report Card](https://goreportcard.com/badge/github.com/godogx/clocksteps)](https://goreportcard.com/report/github.com/godogx/clocksteps)\n[![GoDevDoc](https://img.shields.io/badge/dev-doc-00ADD8?logo=go)](https://pkg.go.dev/github.com/godogx/clocksteps)\n\n`clocksteps` uses [`go.nhat.io/clock`](https://go.nhat.io/clock) to provide steps for `cucumber/godog` and\nmakes it easy to run tests with `time`.\n\n## Prerequisites\n\n- `Go \u003e= 1.17`\n\n## Usage\n\nInitiate the clock and register it to the scenario.\n\n```go\npackage mypackage\n\nimport (\n\t\"testing\"\n\n\t\"github.com/cucumber/godog\"\n\t\"github.com/godogx/clocksteps\"\n)\n\nfunc TestIntegration(t *testing.T) {\n\tclock := clocksteps.New()\n\tsuite := godog.TestSuite{\n\t\tName:                 \"Integration\",\n\t\tTestSuiteInitializer: nil,\n\t\tScenarioInitializer: func(ctx *godog.ScenarioContext) {\n\t\t\tclock.RegisterContext(ctx)\n\t\t},\n\t\tOptions: \u0026godog.Options{\n\t\t\tStrict:    true,\n\t\t\tOutput:    out,\n\t\t\tRandomize: rand.Int63(),\n\t\t},\n\t}\n\t\n\t// Inject the clock to your application then run the suite.\n\tstatus := suite.Run()\n}\n```\n\nRead more about [`go.nhat.io/clock`](https://go.nhat.io/clock)\n\n## Steps\n\n### Set the time\n\nBy default, the clock always returns `time.Now()` unless you freeze or set it. For setting, you can use one of\nthese:\n- `(?:the )?clock is at \"([^\"]*)\"`\n- `(?:the )?clock is set to \"([^\"]*)\"`\n- `sets? (?:the )?clock to \"([^\"]*)\"`\n- `now is \"([^\"]*)\"`\n\nThey have the same effect, the clock will be set at a specific `time.Time`. The given can be in `RFC3339` \n(`2006-01-02T15:04:05Z07:00`) or `YMD` (`2006-01-02`)\n\nFor example:\n\n```gherkin\n    Scenario: Set time\n        Given the clock is at \"2020-01-02T03:04:05Z\"\n        Then the time is \"2020-01-02T03:04:05Z\"\n\n        Given the clock is set to \"2020-02-03T04:05:06Z\"\n        Then the time is \"2020-02-03T04:05:06Z\"\n\n        Given Someone sets the clock to \"2020-03-04T05:06:07Z\"\n        Then the time is \"2020-03-04T05:06:07Z\"\n\n        Given now is \"2020-04-05T06:07:08Z\"\n        Then the time is \"2020-04-05T06:07:08Z\"\n```\n\n### Adjust the time\n\nAfter setting the clock, you can adjust the time by adding a `time.Duration`, some days, months or years with these:\n- `adds? ([^\\s]*) to (?:the )?clock`\n- `adds? ([0-9]+) days? to (?:the )?clock`\n- `adds? ([0-9]+) months? to (?:the )?clock`\n- `adds? ([0-9]+) years? to (?:the )?clock`\n- `adds? ([0-9]+) months?,? ([0-9]+) days? to (?:the )?clock`\n- `adds? ([0-9]+) years?,? ([0-9]+) days? to (?:the )?clock`\n- `adds? ([0-9]+) years?,? ([0-9]+) months? to (?:the )?clock`\n- `adds? ([0-9]+) years?,? ([0-9]+) months?,? ([0-9]+) days? to (?:the )?clock`\n\n**Important**: You have to set the clock before adjusting it. Otherwise you will get `clocksteps.ErrClockIsNotSet` \n\nFor example:\n\n```gherkin\n    Scenario: Add time\n        Given the clock is at \"2020-01-02T03:04:05Z\"\n        And someone adds 1h5s to the clock\n        Then the time is \"2020-01-02T04:04:10Z\"\n\n        Given someone adds 2 days to the clock\n        Then the time is \"2020-01-04T04:04:10Z\"\n```\n\n### Freeze and release the clock\n\n```gherkin\n    Scenario: Freeze and Release\n        Given the time is now\n\n        When I freeze the clock\n        And I wait for 50ms\n        Then the time is not now\n\n        When I wait for 50ms\n        And I release the clock\n        Then the time is now\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodogx%2Fclocksteps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgodogx%2Fclocksteps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodogx%2Fclocksteps/lists"}