{"id":18552371,"url":"https://github.com/traviswimer/grunt-not-constantinople","last_synced_at":"2025-05-15T11:12:37.232Z","repository":{"id":15152757,"uuid":"17880277","full_name":"traviswimer/grunt-not-constantinople","owner":"traviswimer","description":"Grunt task to easily add Istanbul code coverage using any unit-testing framework.","archived":false,"fork":false,"pushed_at":"2016-02-04T00:35:21.000Z","size":36,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-26T16:46:28.577Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/traviswimer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-18T20:08:45.000Z","updated_at":"2022-02-05T16:46:36.000Z","dependencies_parsed_at":"2022-08-25T10:01:54.759Z","dependency_job_id":null,"html_url":"https://github.com/traviswimer/grunt-not-constantinople","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2Fgrunt-not-constantinople","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2Fgrunt-not-constantinople/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2Fgrunt-not-constantinople/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2Fgrunt-not-constantinople/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/traviswimer","download_url":"https://codeload.github.com/traviswimer/grunt-not-constantinople/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328389,"owners_count":22052633,"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-11-06T21:14:00.171Z","updated_at":"2025-05-15T11:12:32.204Z","avatar_url":"https://github.com/traviswimer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-not-constantinople [![Build Status](https://travis-ci.org/traviswimer/grunt-not-constantinople.png?branch=master)](https://travis-ci.org/traviswimer/grunt-not-constantinople)\n\n\u003e Grunt task to easily add Istanbul code coverage using any unit-testing framework.\n\n## Getting Started\nThis plugin requires [Grunt](http://gruntjs.com/) `~0.4.4` -- [Learn to use Grunt](http://gruntjs.com/getting-started)\n\nInstall the plugin with this command:\n\n```shell\nnpm install grunt-not-constantinople --save-dev\n```\n\nEnable in your Gruntfile with:\n\n```js\ngrunt.loadNpmTasks('grunt-not-constantinople');\n```\n\n## Quick setup\n\n```js\ngrunt.initConfig({\n  not_constantinople: {\n    coverage: {\n      options: {\n        unitTestTask: 'mochaTest'\n      }\n    }\n  },\n  mochaTest: {\n    test: {\n      options: {\n        reporter: 'spec'\n      },\n      src: ['tests/**/*.js']\n    }\n  },\n});\n```\n\nThis uses [mochaTest](https://www.npmjs.org/package/grunt-mocha-test) as an example unit testing framework, but you can use any other framework instead. You just have to specify the task to be run as a string value for the `unitTestTask` option.\n\n## The \"not_constantinople\" task\n\n### Overview\nIn your project's Gruntfile, add a section named `not_constantinople` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  not_constantinople: {\n    customized_coverage: {\n      options: {\n        // REQUIRED OPTION - This should be the task that runs your unit tests (e.g. 'mochaTest', 'nodeunit:myTests', etc.)\n        unitTestTask: 'myUnitTestingTask',\n        // directory names to be used for your tests and coverage\n        directories: {\n          root: 'test',\n          coverage: 'coverage',\n          sourceFiles: 'app/*.js'\n        },\n        // Coverage thresholds. Set to false to ignore thresholds\n        thresholds: {\n          statements: 90,\n          branches: 90,\n          lines: 90,\n          functions: 90\n        },\n        // The format of the coverage reports\n        report: {\n          type: 'lcov',\n          print: 'detail'\n        },\n        // removes the contents of the coverage folder before running Istanbul\n        cleanup: true\n      }\n    }\n  },\n});\n```\n\n*All values in this example represent the default values that will be used if they are not specified.*\n\n### Options\n\n#### options.unitTestTask\nType: `String`\n\nThe string value for the Grunt task to be called to run your unit tests.\n\n#### options.directories\nType: `object`\n* __root__ - directory that will contain your coverage directory\n* __coverage__ - directory that will contain all coverage files\n* __sourceFiles__ - The source files that are used by your unit tests\n\n#### options.thresholds\nType: `object`\n* __statements__ - Percent coverage of statements that is considered passing\n* __branches__ - Percent coverage of logical branches that is considered passing\n* __lines__ - Percent coverage of lines that is considered passing\n* __functions__ - Percent coverage of functions that is considered passing\n\n#### options.report\nType: `object`\n* __type__ - type of coverage report (e.g. lcov, html, etc.)\n* __print__\n\n#### options.cleanup\nType: `boolean`\n\nIf `true`, will remove the contents of the coverage folder before running Istanbul.\n\n#### options.instrumentationOptions\nType: `object`\n\nUse this to pass additional Istanbul instrumentation configuration along (some values may be overridden by this task). See the \"instrumentation\" section of the command output from `istanbul help config`.\n\n#### options.reportingOptions\nType: `object`\n\nUse this to pass additional Istanbul reporting configuration along (some values may be overridden by this task). See the \"reporting\" section of the command output from `istanbul help config`.\n\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraviswimer%2Fgrunt-not-constantinople","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftraviswimer%2Fgrunt-not-constantinople","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraviswimer%2Fgrunt-not-constantinople/lists"}