{"id":22452638,"url":"https://github.com/totaltechgeek/qa-exercise-template","last_synced_at":"2025-03-27T12:42:27.678Z","repository":{"id":184557941,"uuid":"672104845","full_name":"TotalTechGeek/QA-Exercise-Template","owner":"TotalTechGeek","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-01T14:50:54.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T17:13:47.065Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TotalTechGeek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-07-29T00:15:50.000Z","updated_at":"2023-07-29T00:15:55.000Z","dependencies_parsed_at":"2024-12-06T06:12:02.363Z","dependency_job_id":"4954ec7a-7f2f-4a6a-b0b3-6e0aedcdf34f","html_url":"https://github.com/TotalTechGeek/QA-Exercise-Template","commit_stats":null,"previous_names":["totaltechgeek/qa-exercise-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotalTechGeek%2FQA-Exercise-Template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotalTechGeek%2FQA-Exercise-Template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotalTechGeek%2FQA-Exercise-Template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotalTechGeek%2FQA-Exercise-Template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TotalTechGeek","download_url":"https://codeload.github.com/TotalTechGeek/QA-Exercise-Template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245850137,"owners_count":20682632,"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","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-12-06T06:11:56.772Z","updated_at":"2025-03-27T12:42:27.655Z","avatar_url":"https://github.com/TotalTechGeek.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test Application with Node.js runtime\n\nThis application is a simple prototype of a templating engine. It allows you to pass in templates (created with Handlebars.js syntax), schemas for the data to be passed in, and logic to be run on the data before the template is processed.\n\nGiven the following template:\n```json\n{\n  \"name\": \"Birthday Card\",\n  \"description\": \"A card that says happy birthday.\",\n  \"template\": \"\u003cb\u003eHello {{name}}!\u003c/b\u003e\u003cbr/\u003e Happy {{age}}th birthday!\u003cbr/\u003e {{turning}} is coming up soon!\",\n  \"headers\": [\n    {\n      \"name\": \"Content-Type\",\n      \"value\": \"text/html\"\n    }\n  ],\n  \"dataSchema\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"name\": {\n        \"type\": \"string\"\n      },\n      \"age\": {\n        \"type\": \"number\"\n      }\n    },\n    \"required\": [\n      \"name\",\n      \"age\"\n    ]\n  },\n  \"logic\": {\n    \"turning\": {\n      \"+\": [\n        {\n          \"var\": \"age\"\n        },\n        1\n      ]\n    }\n  }\n}\n```\n\nAnd the following data:\n```json\n{\n  \"name\": \"John\",\n  \"age\": 30\n}\n```\n\nThe following output would be generated:\n```html\n\u003cb\u003eHello John!\u003c/b\u003e\u003cbr/\u003e Happy 30th birthday!\u003cbr/\u003e 31 is coming up soon!\n```\n\nThe engine allows you to create multiple templates, and add schemas and logic to each one. \n\n## Getting Started\n\nYou will need to have Node.js 18 or newer (this application is built for Active LTS or Current releases of Node.js) and Yarn installed on your machine.\n\n```bash\nyarn\n```\nThis will install the necessary dependencies\n\n\nTo start the development server run:\n```bash\nyarn run dev\n```\n\nOpen http://localhost:6250/swagger with your browser to see the result. \n\nThis will present you with a Swagger UI to test the API manually and provide you with the API documentation.\n\n## Your Task\n\nHey! Thank you for taking the time to consider this coding challenge. We really appreciate it!\n\nYour task is to test the API and write automated tests for it. You can use any testing framework you like (Newman, Cucumber, Jest, whatever you feel is appropriate)!\n\nThe goals are to:\n\n- Ensure that each API is working as expected.\n- Ensure that each API is returning the correct response codes \u0026 errors when necessary.\n- Ensure that if headers are supplied to the template, they are returned in the response. (Like the Content-Type header in the example above, useful for things like SVGs)\n- Ensure that the logic is being applied correctly to the data before the template is processed. (Like the \"turning\" logic in the example above)\n- Ensure that the data is being validated against the schema before the template is processed. (Like the \"dataSchema\" in the example above)\n- Bonus: Check to see if there is an XSS vulnerability. See if you can add JavaScript to the template and have it execute.\n\nSome resources that may be helpful, but are not necessary to use the examples provided:\n- https://json-schema.org/\n- https://handlebarsjs.com/\n- https://jsonlogic.com/\n\n\nIf you're looking to interface with the APIs a bit more directly, this might be of use as well:\n- https://elysiajs.com/patterns/lazy-loading-module.html#testing\n\nYou can use the examples provided in the `examples` folder to test the API.\n- [receipt.md](examples/receipt.md)\n- [icon.md](examples/icon.md)\n- [birthday.md](examples/birthday.md)\n\nYou are also encouraged to create your own examples to test the API with.\n\nYou are encouraged to fork this repository. \n\nP.S. \n\nIf you're wanting to do \"Database Validations\" as well, there is a \"data.json\" file that is produced. (I wanted to avoid requiring individuals to set up a database for this challenge, but if you want to, you can use this file as a database.)\n\nYou may also delete the file if you want to start fresh. It will be recreated when the application is restarted.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotaltechgeek%2Fqa-exercise-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftotaltechgeek%2Fqa-exercise-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotaltechgeek%2Fqa-exercise-template/lists"}