{"id":16871305,"url":"https://github.com/bbc/ShouldIT","last_synced_at":"2025-11-12T18:30:16.750Z","repository":{"id":18762862,"uuid":"21975501","full_name":"bbc/ShouldIT","owner":"bbc","description":"A language agnostic BDD framework.","archived":false,"fork":false,"pushed_at":"2016-02-04T09:30:19.000Z","size":2081,"stargazers_count":53,"open_issues_count":2,"forks_count":7,"subscribers_count":64,"default_branch":"master","last_synced_at":"2025-02-17T00:32:52.580Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://bbc-sport.github.io/ShouldIT/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"nablarch/nablarch-core","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbc.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}},"created_at":"2014-07-18T09:43:35.000Z","updated_at":"2024-11-02T11:47:44.000Z","dependencies_parsed_at":"2022-07-20T10:04:19.885Z","dependency_job_id":null,"html_url":"https://github.com/bbc/ShouldIT","commit_stats":null,"previous_names":["bbc-sport/shouldit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2FShouldIT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2FShouldIT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2FShouldIT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2FShouldIT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbc","download_url":"https://codeload.github.com/bbc/ShouldIT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239599758,"owners_count":19666050,"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-10-13T15:07:58.343Z","updated_at":"2025-11-12T18:30:16.646Z","avatar_url":"https://github.com/bbc.png","language":"JavaScript","readme":"[![Build Status](https://secure.travis-ci.org/bbc/ShouldIT.png?branch=master)](http://travis-ci.org/bbc/ShouldIT)\n\n# ShouldIT?\n\nThis is a BDD tool for checking and spec-ing tests against beautiful looking feature files written in MarkDown.\n\n## Getting Started with Examples\n\nThe quickest way to get going and have a flavour of how this works is through the examples.\n\n[ShouldIT? Example Repository](https://github.com/bbc/ShouldIT-Examples)\n\n### How it works...\n\nRather than this tool driving your tests it is a test output parser which means you can test natively in various programming languages freely. This tool will watch for the test output files or feature file to be saved at which point shows you what specs have and haven't been implemented. \n\n## The Feature File\n\nYou can write feature files in markdown. You can add any information you want in any way to describe your features. However adding the following style of syntax.\n\n```\n# My Feature\n\nThis can contain explanations and other details about your feature\n\n## My Context\n\n+ IT should have a test that passes\n- IT may not have a test that is skipped\n\n## My Other Context\n\n+ IT should also have other tests passing in other contexts\n    - You can add other ignored meta-data\n```\n## Using Javascript Tests\n\nThis tool particularly likes Javascript testing frameworks (Jasmine or Mocha). \n\nThe above specs you can write in a JS test as follows:\n\n\n```javascript\ndescribe(\"My Feature\", function () {\n    describe(\"My Context\", function () {\n        it(\"should have a test that passes\", function () {\n            ...\n        });\n    });\n    describe(\"My Other Context\", function () {\n        it(\"should also have other tests passing in other contexts\", function () {\n            ...\n        });\n    });\n});\n```\n\n### Test output files\n\n#### Jasmine/Karma\n\nYou can get the test output in a format that `ShouldIT?` understands by using a custom Karma reporter called `karma-spec-json-reporter`. This is an NPM package that can be [found here](https://www.npmjs.org/package/karma-spec-json-reporter). \n\nPlease follow the instructions there to install it.\n\n#### Mocha\n\nSimilarly to Karma there is a `mocha-spec-json-reporter`. This is also an NPM package that can be [found here](https://www.npmjs.org/package/mocha-spec-json-reporter).\n\n### Using JUnit output\n\nTake the following test written in Java\n```java\npackage com.example.foo;\n\nimport org.junit.Test;\nimport org.junit.Ignore;\nimport org.junit.runner.RunWith;\nimport org.junit.runners.JUnit4;\nimport org.junit.Assert.assertTrue;\n\n/**\n * Tests for {@link Foo}.\n */\npublic class ContextSubcontextTest {\n\n    @Test\n    public void shouldAlwaysPass() {\n        assertTrue(\"failure - should be true\", true);\n    }\n\n}\n```\nThis will then output JUnitXML similar to the below:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003ctestsuite name=\"com.example.foo.ContextSubcontextTest\" time=\"0.005\" tests=\"1\" errors=\"0\" skipped=\"0\" failures=\"0\"\u003e\n  \u003cproperties\u003e\n    \u003cproperty name=\"java.runtime.name\" value=\"Java(TM) SE Runtime Environment\"/\u003e\n  \u003c/properties\u003e\n  \u003ctestcase name=\"shouldAlwaysPass\" classname=\"com.example.foo.ContextSubcontextTest\" time=\"0\"/\u003e\n\u003c/testsuite\u003e\n```\nThis we can then line up to a feature file that looks like the following.\n\n```\n# Context\n\n## Subscontext\n\n+ IT should always pass\n```\nSo you can also use anything that also outputs similar JUnitXML including PHPUnit and the likes.\n\n## Running ShouldIT\n \nWhen you have output files available you can do a comparison run using the following command\n```\n./node_modules/shouldit/bin/shouldit --specs=\"path-to-features/*.md\" --results=\"path-to-json/*.json,path-to-junit/*.xml\"\n```\n\nYou will then see some pretty output and a `junit-output.xml` file that will give you a coverage summary.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2FShouldIT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbc%2FShouldIT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2FShouldIT/lists"}