{"id":15598180,"url":"https://github.com/boneskull/angular-mocks-node","last_synced_at":"2025-08-17T05:31:33.930Z","repository":{"id":23792837,"uuid":"27168575","full_name":"boneskull/angular-mocks-node","owner":"boneskull","description":"AngularJS' ngMock module provided as a CommonJS module.","archived":false,"fork":false,"pushed_at":"2014-11-28T02:38:41.000Z","size":116,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-15T08:39:51.582Z","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/boneskull.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-11-26T09:11:45.000Z","updated_at":"2015-03-30T11:56:15.000Z","dependencies_parsed_at":"2022-09-12T21:41:59.079Z","dependency_job_id":null,"html_url":"https://github.com/boneskull/angular-mocks-node","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boneskull%2Fangular-mocks-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boneskull%2Fangular-mocks-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boneskull%2Fangular-mocks-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boneskull%2Fangular-mocks-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boneskull","download_url":"https://codeload.github.com/boneskull/angular-mocks-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230092075,"owners_count":18171625,"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-03T01:29:44.619Z","updated_at":"2024-12-17T09:24:53.713Z","avatar_url":"https://github.com/boneskull.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# angular-mocks-node\n\nAngularJS' [ngMock](https://docs.angularjs.org/api/ngMock) module provided as a CommonJS module.\n \nPaired with [angular-node](https://www.npmjs.org/package/angular-node), you can use this module to take advantage of `ngMock` on the server side.  Run your tests headlessly!\n \n## Rationale\n\nThe [angular-mocks](https://www.npmjs.org/package/angular-mocks) module provides a couple convenience functions (`module()`, `inject()`) which are not present if certain variables do not exist in the global context (`window`).\n\nIn NodeJS, there's very little in the global context, and there's no `window`.\n\nThis module sets the table for `ngMock`, and allows `module()` and `inject()` to be exposed on the `angular.mock` object.\n\n## Example\n\n```js\n\nvar ngMock = require('angular-mocks-node');\n\ndescribe('my suite', function() {\n  \n  beforeEach(ngMock.module('myModule'));\n  \n  it('should do such-and-such', ngMock.inject(function(MyService) {\n    // make assertions\n  });\n});\n```\n\n## Notes\n\nThe `angular.mock` object is both exported by the `angular-mocks-node` module, as well as exposed on the `angular` object:\n\n```js\nvar angular = require('angular-node');\nvar ngMock = require('angular-mocks-node');\nangular.mock === ngMock; // true\n```\n\n## Supported Test Frameworks\n\n- [Mocha](http://mochajs.org)\n- [Jasmine](http://jasmine.github.io)\n- Anything else, really, but you won't get the convenience functions, because `ngMock` is written that way.\n\n## Maintainer\n\n[Christopher Hiller](http://boneskull.github.io)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboneskull%2Fangular-mocks-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboneskull%2Fangular-mocks-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboneskull%2Fangular-mocks-node/lists"}