{"id":13847280,"url":"https://github.com/sysgears/mochapack","last_synced_at":"2025-05-14T22:08:34.200Z","repository":{"id":33786662,"uuid":"162255608","full_name":"sysgears/mochapack","owner":"sysgears","description":"Mocha test runner with integrated webpack precompiler","archived":false,"fork":false,"pushed_at":"2025-04-08T17:59:14.000Z","size":2664,"stargazers_count":181,"open_issues_count":25,"forks_count":27,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-13T18:44:39.574Z","etag":null,"topics":["mocha","webpack"],"latest_commit_sha":null,"homepage":"https://sysgears.github.io/mochapack/","language":"TypeScript","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/sysgears.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2018-12-18T08:30:15.000Z","updated_at":"2025-04-08T17:59:18.000Z","dependencies_parsed_at":"2025-02-28T11:18:02.782Z","dependency_job_id":"2c74dca2-274f-4d59-b6b2-cb133da37e28","html_url":"https://github.com/sysgears/mochapack","commit_stats":{"total_commits":250,"total_committers":38,"mean_commits":6.578947368421052,"dds":0.476,"last_synced_commit":"38012769f63cc4666b1f4df476162fee66acfc85"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysgears%2Fmochapack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysgears%2Fmochapack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysgears%2Fmochapack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysgears%2Fmochapack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysgears","download_url":"https://codeload.github.com/sysgears/mochapack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235700,"owners_count":22036964,"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":["mocha","webpack"],"created_at":"2024-08-04T18:01:15.432Z","updated_at":"2025-05-14T22:08:29.182Z","avatar_url":"https://github.com/sysgears.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# mochapack [![Join the chat at https://gitter.im/sysgears/mochapack](https://badges.gitter.im/sysgears/mochapack.svg)](https://gitter.im/sysgears/mochapack?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) [![npm package][npm-badge]][npm] [![Build Status][build-badge]][build]  [![Twitter Follow](https://img.shields.io/twitter/follow/sysgears.svg?style=social)](https://twitter.com/sysgears)\n\nThis project is a fork of [mocha-webpack](https://github.com/zinserjan/mocha-webpack). We have created this fork since there is no visible activity from original author for a long time.\n\n\u003e mocha test runner with integrated webpack precompiler\n\nmochapack is basically a wrapper around the following command...\n\n```bash\n$ webpack test.js output.js \u0026\u0026 mocha output.js\n```\n\n... but in a much more _powerful_ \u0026 _optimized_ way.\n\n![CLI](./docs/media/cli-test-success.png)\n\nmochapack ...\n\n- precompiles your test files automatically with webpack before executing tests\n- handles source-maps automatically for you\n- does not write any files to disk\n- understands globs \u0026 all other stuff as test entries like mocha\n\nBenefits over plain mocha\n\n- has nearly the same CLI as mocha\n- you don't rely on hacky solutions to mock all benefits from webpack, like path resolution\n- mochapack provides a much better watch mode than mocha\n\n## Watch mode (`--watch`)\n\nUnlike mocha, mochapack analyzes your dependency graph and run only those test files that were affected by this file change.\n\nYou'll get continuous feedback whenever you make changes as all tests that are related in any way to this change will be tested again. Isn't that awesome?\n\nIf any build errors happens, they will be shown like below\n\n![CLI](./docs/media/cli-compile-failed.png)\n\n## Which version works with mochapack?\n\nmochapack works with\n\n- webpack in versions `4.x.x` - `5.x.x`\n- mocha in versions `5.x.x` - `9.x.x`\n\n## Installation\n\nInstall mochapack via npm install\n\n```bash\n$ npm install webpack mocha mochapack --save-dev\n```\n\nand use it via npm scripts in your `package.json`\n\nFurther installation and configuration instructions can be found in the [installation chapter](./docs/installation/setup.md).\n\n## Sample commands\n\nrun a single test\n\n```bash\nmochapack simple.test.js\n```\n\nrun all tests by glob\n\n```bash\nmochapack \"test/**/*.js\"\n```\n\n**Note:** You may noticed the quotes around the glob pattern. That's unfortunately necessary as most terminals will resolve globs automatically.\n\nrun all tests in directory \"test\" matching the file pattern \\*.test.js (add `--recursive` to include subdirectories)\n\n```bash\nmochapack --glob \"*.test.js\" test\n```\n\nWatch mode? just add `--watch`\n\n```\nmochapack --watch test\n```\n\n## Contributing\n\nThis project uses [nari] package manager to have reproducible builds without resorting to lockfiles, it uses `lockTime` field in `package.json` instead.\n\nTo install `nari` execute:\n`npm i -g nari`\n\nAnd then `nari` to install the project.\n\nTo run project scripts use `nari script_name`, for example `nari test` to run unit tests.\n\n## License\n\nThis source code is licensed under the [MIT] license.\u003cbr/\u003e\nCopyright \u0026copy; 2016-2017 Jan-André Zinser\u003cbr/\u003e\nCopyright \u0026copy; 2018 [SysGears (Cyprus) Limited].\n\n[nari]: https://github.com/narijs/nari\n[build-badge]: https://github.com/sysgears/mochapack/actions/workflows/build-and-test.yml/badge.svg\n[build]: https://github.com/sysgears/mochapack/actions/workflows/build-and-test.yml\n[npm-badge]: https://img.shields.io/npm/v/mochapack.svg?style=flat-square\n[npm]: https://www.npmjs.org/package/mochapack\n[codecov-badge]: https://codecov.io/gh/sysgears/mochapack/branch/master/graph/badge.svg\n[codecov]: https://codecov.io/gh/sysgears/mochapack\n[sysgears (cyprus) limited]: https://sysgears.com\n[mit]: LICENSE.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysgears%2Fmochapack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysgears%2Fmochapack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysgears%2Fmochapack/lists"}