{"id":14967394,"url":"https://github.com/nordcloud/serverless-jest-plugin","last_synced_at":"2025-04-05T04:13:28.490Z","repository":{"id":47734549,"uuid":"79661233","full_name":"nordcloud/serverless-jest-plugin","owner":"nordcloud","description":"Plugin for Serverless Framework which adds support for test-driven development using Jest","archived":false,"fork":false,"pushed_at":"2024-05-25T08:36:58.000Z","size":631,"stargazers_count":120,"open_issues_count":24,"forks_count":51,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-29T03:06:10.116Z","etag":null,"topics":["mocha","serverless-framework","serverless-plugin","test-driven-development"],"latest_commit_sha":null,"homepage":"","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/nordcloud.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-21T17:33:39.000Z","updated_at":"2024-07-21T19:04:06.000Z","dependencies_parsed_at":"2024-06-18T14:02:33.822Z","dependency_job_id":"f3f3a0ba-6fa6-4f33-849f-76b1e6a23b29","html_url":"https://github.com/nordcloud/serverless-jest-plugin","commit_stats":{"total_commits":66,"total_committers":15,"mean_commits":4.4,"dds":0.6212121212121212,"last_synced_commit":"b7335aed6a821803d37c7f7d8a3f880500b06db8"},"previous_names":["sc5/serverless-jest-plugin"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fserverless-jest-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fserverless-jest-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fserverless-jest-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fserverless-jest-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nordcloud","download_url":"https://codeload.github.com/nordcloud/serverless-jest-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284951,"owners_count":20913704,"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","serverless-framework","serverless-plugin","test-driven-development"],"created_at":"2024-09-24T13:37:59.655Z","updated_at":"2025-04-05T04:13:28.469Z","avatar_url":"https://github.com/nordcloud.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless Jest Plugin\n\n[![Build Status](https://travis-ci.org/nordcloud/serverless-jest-plugin.svg?branch=master)](https://travis-ci.org/nordcloud/serverless-jest-plugin)\n\nA Serverless Plugin for the [Serverless Framework](http://www.serverless.com) which\nadds support for test-driven development using [jest](https://facebook.github.io/jest/)\n\n**THIS PLUGIN REQUIRES SERVERLESS V1.0 OR LATER!**\n\nMore familiar with Mocha? Try [serverless-mocha-plugin](https://github.com/nordcloud/serverless-mocha-plugin).\n\n## Introduction\n\nThis plugins does the following:\n\n* It provides commands to create and run tests manually\n* It provides a command to create a function, which automatically also creates a test\n\n## Installation\n\nIn your service root, run:\n\n```bash\nnpm install --save-dev serverless-jest-plugin\n```\n\nAdd the plugin to `serverless.yml`:\n\n```yml\nplugins:\n  - serverless-jest-plugin\ncustom:\n  jest:\n    # You can pass jest options here\n    # See details here: https://facebook.github.io/jest/docs/configuration.html\n    # For instance, uncomment next line to enable code coverage\n    # collectCoverage: true\n```\n\n## Usage\n\n### Creating functions\n\nFunctions (and associated tests) can be created using the command\n\n```\nsls create function -f functionName --handler handler\n```\n \ne.g.\n\n```\nsls create function -f myFunction --handler functions/myFunction/index.handler\n```\n\ncreates a new function `myFunction` into `serverless.yml` with a code template for\nthe handler in `functions/myFunction/index.js` and a Javascript function `module.exports.handler` \nas the entrypoint for the Lambda function. A test template is also created into `test/myFunction.js`. Optionally tests can be created to specific folder using `--path` or `-p` switch, e.g. \n\n```\nsls create function -f myFunction --handler functions/myFunction/index.handler --path tests\n```\n\nTo create tests next to handler use `--path {function}`, in following example test file `myFunction.test.js` is created to `functions/myFunction/` directory.\n\n```\nsls create function -f myFunction --handler functions/myFunction/index.handler --path {function}\n```\n\n### Creating tests\n\nTests can also be added to existing handlers using\n\n```\nsls create test -f functionName\n```\n\n### Running tests\n\nTests can be run directly using Jest or using the \"invoke test\" command\n\n```\nsls invoke test [--stage stage] [--region region] [-f function]\n```\n\nIf no function names are passed to \"invoke test\", all tests related to handler functions are run.\n\n## License\nhttps://github.com/nordcloud/serverless-jest-plugin/blob/master/LICENSE","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordcloud%2Fserverless-jest-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnordcloud%2Fserverless-jest-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordcloud%2Fserverless-jest-plugin/lists"}