{"id":20551458,"url":"https://github.com/generate/generate-mocha","last_synced_at":"2025-04-14T11:22:20.353Z","repository":{"id":57246148,"uuid":"56812585","full_name":"generate/generate-mocha","owner":"generate","description":"Generate mocha unit tests.","archived":false,"fork":false,"pushed_at":"2017-10-17T02:22:43.000Z","size":447,"stargazers_count":8,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T00:41:31.082Z","etag":null,"topics":["app","cli","create","dev","generate","generator","init","initialize","new","project","prompt","scaffold","scaffolder","scaffolding","template","yeoman","yo"],"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/generate.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":"2016-04-21T23:52:23.000Z","updated_at":"2023-07-12T18:11:04.000Z","dependencies_parsed_at":"2022-08-24T16:31:39.427Z","dependency_job_id":null,"html_url":"https://github.com/generate/generate-mocha","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fgenerate-mocha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fgenerate-mocha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fgenerate-mocha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fgenerate-mocha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/generate","download_url":"https://codeload.github.com/generate/generate-mocha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248564657,"owners_count":21125408,"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":["app","cli","create","dev","generate","generator","init","initialize","new","project","prompt","scaffold","scaffolder","scaffolding","template","yeoman","yo"],"created_at":"2024-11-16T02:31:05.968Z","updated_at":"2025-04-14T11:22:20.330Z","avatar_url":"https://github.com/generate.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n\n\u003ca href=\"https://github.com/generate/generate\"\u003e\n\u003cimg height=\"150\" width=\"150\" src=\"https://raw.githubusercontent.com/generate/generate/master/docs/logo.png\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\nGenerate mocha test files.\n\n# generate-mocha\n\n[![NPM version](https://img.shields.io/npm/v/generate-mocha.svg?style=flat)](https://www.npmjs.com/package/generate-mocha) [![NPM downloads](https://img.shields.io/npm/dm/generate-mocha.svg?style=flat)](https://npmjs.org/package/generate-mocha) [![Build Status](https://img.shields.io/travis/generate/generate-mocha.svg?style=flat)](https://travis-ci.org/generate/generate-mocha)\n\n![generate-mocha demo](https://raw.githubusercontent.com/generate/generate-mocha/master/docs/demo.gif)\n\n## Table of Contents\n\n- [Quickstart](#quickstart)\n- [Files trees](#files-trees)\n- [What is \"Generate\"?](#what-is-generate)\n- [Getting started](#getting-started)\n  * [Install](#install)\n  * [Usage](#usage)\n  * [Help](#help)\n- [About](#about)\n  * [Related projects](#related-projects)\n  * [Community](#community)\n  * [Contributing](#contributing)\n  * [Running tests](#running-tests)\n  * [Release history](#release-history)\n  * [Author](#author)\n  * [License](#license)\n\n_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_\n\n## Quickstart\n\n**Install**\n\nInstall [generate](https://github.com/generate/generate) and `generate-mocha`:\n\n```sh\n$ npm install --global generate generate-mocha\n```\n\n**Generate a test.js file**\n\nInitiate a prompt to generate a `test.js` file in the current working directory:\n\n```sh\n$ gen mocha\n$ gen mocha --dest ./foo\n```\n\n## Files trees\n\nThe following files trees are automatically generated by a task in [verbfile.js](verbfile.js).\n\n* [generated files](#generated-files): trees representing the actual generated \"dest\" files for each task\n* [source files](#source-files): trees representing the source files and templates used by each task\n\n_(See Generate's [customization docs ](https://github.com/generate/generate/blob/master/docs/customization.md) to learn how to override individual templates.)_\n\n### Generated files\n\nFiles generated by each task (e.g. `dest` files). See the Generate [customization docs ](https://github.com/generate/generate/blob/master/docs/customization.md) to learn how to override individual templates.\n\nNote that diffs are base on comparisons against the files generated by the `default` task. Additionally, some tasks generate the same files, but with different contents (for example, the contents of `index.js` differs based on the task).\n\n#### default\n\nFiles generated by the [default task](#default):\n\n```diff\n .\n └── test.js\n```\n\n#### base\n\nFiles generated by the [base task](#base):\n\n```diff\n .\n └── test.js\n```\n\n#### generator\n\nFiles generated by the [generator task](#generator):\n\n```diff\n .\n+└─┬ test\n   ├── test.js\n+  └── plugin.js\n```\n\n#### updater\n\nFiles generated by the [updater task](#updater):\n\n```diff\n .\n+└─┬ test\n   ├── test.js\n+  └── plugin.js\n```\n\n### Source files\n\nThe following trees represent the source files or templates that are used by each task. You'll see that most of the tasks use at least one \"micro-generator\" to generate a specific file.\n\n#### default\n\nSource files and/or libraries used by the [default task](#default):\n\n```diff\n .\n └─┬ templates\n   ├── base.js\n   └── test.js\n```\n\n#### base\n\nSource files and/or libraries used by the [base task](#base):\n\n```diff\n .\n └─┬ templates\n   └── base.js\n```\n\n#### generator\n\nSource files and/or libraries used by the [generator task](#generator):\n\n```diff\n .\n └─┬ scaffolds\n   └─┬ generator\n     └─┬ templates\n       ├── plugin.js\n       └── test.js\n```\n\n#### updater\n\nSource files and/or libraries used by the [updater task](#updater):\n\n```diff\n .\n └─┬ scaffolds\n   └─┬ updater\n     └─┬ templates\n       ├── plugin.js\n       └── test.js\n```\n\n## What is \"Generate\"?\n\nGenerate is a command line tool and developer framework for scaffolding out new GitHub projects using [generators](https://github.com/generate/generate/blob/master/docs/generators.md) and [tasks](https://github.com/generate/generate/blob/master/docs/tasks.md).\n\nAnswers to prompts and the user's environment can be used to determine the templates, directories, files and contents to build. Support for [gulp](http://gulpjs.com), [base](https://github.com/node-base/base) and [assemble](https://github.com/assemble/assemble) plugins, and much more.\n\n**For more information**:\n\n* Visit the [generate project](https://github.com/generate/generate/)\n* Visit the [generate documentation](https://github.com/generate/generate/blob/master/docs/)\n* Find [generators on npm](https://www.npmjs.com/browse/keyword/generate-generator) (help us [author generators](https://github.com/generate/generate/blob/master/docs/micro-generators.md))\n\n## Getting started\n\n### Install\n\n**Installing the CLI**\n\nTo run the `mocha` generator from the command line, you'll need to install [Generate](https://github.com/generate/generate) globally first. You can do that now with the following command:\n\n```sh\n$ npm install --global generate\n```\n\nThis adds the `gen` command to your system path, allowing it to be run from any directory.\n\n**Install generate-mocha**\n\nInstall this module with the following command:\n\n```sh\n$ npm install --global generate-mocha\n```\n\n### Usage\n\nRun this generator's `default` [task](https://github.com/generate/generate/blob/master/docs/tasks.md#default) with the following command:\n\n```sh\n$ gen mocha\n```\n\n**What you should see in the terminal**\n\nIf completed successfully, you should see both `starting` and `finished` events in the terminal, like the following:\n\n```sh\n[00:44:21] starting ...\n...\n[00:44:22] finished ✔\n```\n\nIf you do not see one or both of those events, please [let us know about it](../../issues).\n\n### Help\n\nTo see a general help menu and available commands for Generate's CLI, run:\n\n```sh\n$ gen help\n```\n\n## Tasks\n\nAll available tasks.\n\n### [default](generator.js#L55)\n\nAlias for the [test](#test) task. Allows the generator to be run with the following command:\n\n**Example**\n\n```sh\n$ gen mocha\n```\n\n### [base](generator.js#L67)\n\nGenerate a `test.js` file with unit tests for a [base](https://github.com/node-base/base) project.\n\n**Example**\n\n```sh\n$ gen mocha:base\n```\n\n### [gulp](generator.js#L79)\n\nGenerate a `test.js` file with unit tests for a [gulp](http://gulpjs.com) plugin project.\n\n**Example**\n\n```sh\n$ gen mocha:gulp\n```\n\n### [generator](generator.js#L96)\n\nGenerate unit tests for a [generate](https://github.com/generate/generate) generator. Creates:\n\n* `test.js`\n* `plugin.js`\n\n**Example**\n\n```sh\n$ gen mocha:gen\n# aliased as\n$ gen mocha:generator\n```\n\n### [updater](generator.js#L112)\n\nGenerate unit tests for an [update](https://github.com/update/update) \"updater\". Creates:\n\n* `test.js`\n* `plugin.js`\n\n**Example**\n\n```sh\n$ gen mocha:updater\n```\n\nVisit Generate's [documentation for tasks](https://github.com/generate/generate/blob/master/docs/tasks.md).\n\n## About\n\n### Related projects\n\n* [generate-git](https://www.npmjs.com/package/generate-git): Generator for initializing a git repository and adding first commit. | [homepage](https://github.com/generate/generate-git \"Generator for initializing a git repository and adding first commit.\")\n* [generate-license](https://www.npmjs.com/package/generate-license): Generate a license file for a GitHub project. | [homepage](https://github.com/generate/generate-license \"Generate a license file for a GitHub project.\")\n* [generate-node](https://www.npmjs.com/package/generate-node): Generate a node.js project, with everything you need to begin writing code and easily publish… [more](https://github.com/generate/generate-node) | [homepage](https://github.com/generate/generate-node \"Generate a node.js project, with everything you need to begin writing code and easily publish the project to npm.\")\n* [generate](https://www.npmjs.com/package/generate): Command line tool and developer framework for scaffolding out new GitHub projects. Generate offers the… [more](https://github.com/generate/generate) | [homepage](https://github.com/generate/generate \"Command line tool and developer framework for scaffolding out new GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.\")\n\n### Community\n\nAre you using [Generate](https://github.com/generate/generate) in your project? Have you published a [generator](https://github.com/generate/generate/blob/master/docs/generators.md) and want to share your project with the world?\n\nHere are some suggestions!\n\n* If you get like Generate and want to tweet about it, please feel free to mention `@generatejs` or use the `#generatejs` hashtag\n* Show your love by starring [Generate](https://github.com/generate/generate) and `generate-mocha`\n* Get implementation help on [StackOverflow](http://stackoverflow.com/questions/tagged/generate) (please use the `generatejs` tag in questions)\n* **Gitter** Discuss Generate with us on [Gitter](https://gitter.im/generate/generate)\n* If you publish an generator, thank you! To make your project as discoverable as possible, please add the keyword `generategenerator` to package.json.\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm install -d \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT license](https://github.com/generate/generate-mocha/blob/master/LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on August 17, 2016._","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenerate%2Fgenerate-mocha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgenerate%2Fgenerate-mocha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenerate%2Fgenerate-mocha/lists"}