{"id":20128210,"url":"https://github.com/thenewdynamic/hugo-module-tnd-tests","last_synced_at":"2026-03-09T14:34:01.633Z","repository":{"id":75047727,"uuid":"280480714","full_name":"theNewDynamic/hugo-module-tnd-tests","owner":"theNewDynamic","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-22T21:21:20.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-28T02:58:54.388Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/theNewDynamic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-07-17T17:03:16.000Z","updated_at":"2021-03-22T21:21:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"972a152a-b1f7-457f-bc0b-ee03932c41e3","html_url":"https://github.com/theNewDynamic/hugo-module-tnd-tests","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"theNewDynamic/hugo-module-tnd-template-repo","purl":"pkg:github/theNewDynamic/hugo-module-tnd-tests","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theNewDynamic%2Fhugo-module-tnd-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theNewDynamic%2Fhugo-module-tnd-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theNewDynamic%2Fhugo-module-tnd-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theNewDynamic%2Fhugo-module-tnd-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theNewDynamic","download_url":"https://codeload.github.com/theNewDynamic/hugo-module-tnd-tests/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theNewDynamic%2Fhugo-module-tnd-tests/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30299110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T14:33:48.460Z","status":"ssl_error","status_checked_at":"2026-03-09T14:33:48.027Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-13T20:26:12.752Z","updated_at":"2026-03-09T14:34:01.606Z","avatar_url":"https://github.com/theNewDynamic.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TND Tests Hugo Module\n\nA simple repo to run unit tests on TND Module features. For now it only tests partials.\n\n## Requirements\n\nRequirements:\n- Go 1.14\n- Hugo 0.61.0\n\n\n## Installation\n\nIf not already, [init](https://gohugo.io/hugo-modules/use-modules/#initialize-a-new-module) your project as Hugo Module:\n\n```\n$: hugo mod init {repo_url}\n```\n\nConfigure your project's module to import this module:\n\n```yaml\n# config.yaml\nmodule:\n  imports:\n  - path: github.com/theNewDynamic/hugo-module-tnd-tests\n```\n\n## Usage\n\nEach partials to be tested can count as many as 10 unit tests, each sporting a different context and expected returned value.\n\n### Directory Structure.\n\nTo create unit test on a given partial located or mounted in `layouts/partials/images/GetFeatureImage.html`\nUser should create two partials per unit tests:\n1. `layouts/partials/tnd-tests/partials/images/GetFeaturedImage/1/context.html`\n  The above should return the context to be passed to the partial for the unit test number 1\n2. `layouts/partials/tnd-tests/partials/images/Add/1/GetFeaturedImage/excpected.html`\n  The above should return the expected value returned by the partial when aforementioned context is passed.\n\n#### GetFeaturedImage unit test 1\n\n```\n{{/* layouts/partials/tnd-tests/partials/images/GetFeaturedImage/1/context.html */}}\n{{ return site.GetPage \"/post/monaco\" }}\n```\n\n```\n{{/* layouts/partials/tnd-tests/partials/images/GetFeaturedImage/1/expected.html */}}\n{{ return \"/uploads/grand-prix.jpg\" }}\n```\n\n#### GetFeaturedImage unit test 2\n```\n{{/* layouts/partials/tnd-tests/partials/images/GetFeaturedImage/1/context.html */}}\n{{ return site.GetPage \"/post/san-francisco\" }}\n```\n\n```\n{{/* layouts/partials/tnd-tests/partials/images/GetFeaturedImage/1/expected.html */}}\n{{ return \"/uploads/golden-gate.jpg\" }}\n```\n\n### Some Partial/Feature\n\n#### GetPartialUnitTests\n\nThis will return an array of the results and data of every unit tests of a given partial.\n\n#### testPartial\n\nThis will return a boolean. True if every unit tests of a given partial succeeds, false if one or more fails.\n\n## theNewDynamic\n\nThis project is maintained and love by [thenewDynamic](https://www.thenewdynamic.com).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenewdynamic%2Fhugo-module-tnd-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthenewdynamic%2Fhugo-module-tnd-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenewdynamic%2Fhugo-module-tnd-tests/lists"}