{"id":24678304,"url":"https://github.com/firstclasspostcodes/localstack","last_synced_at":"2025-03-21T18:23:33.213Z","repository":{"id":54416809,"uuid":"265860077","full_name":"firstclasspostcodes/localstack","owner":"firstclasspostcodes","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-19T07:26:20.000Z","size":775,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-09T16:36:27.930Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/firstclasspostcodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-21T13:47:52.000Z","updated_at":"2021-02-19T07:26:21.000Z","dependencies_parsed_at":"2022-08-13T15:00:49.744Z","dependency_job_id":null,"html_url":"https://github.com/firstclasspostcodes/localstack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstclasspostcodes%2Flocalstack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstclasspostcodes%2Flocalstack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstclasspostcodes%2Flocalstack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstclasspostcodes%2Flocalstack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstclasspostcodes","download_url":"https://codeload.github.com/firstclasspostcodes/localstack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244595532,"owners_count":20478496,"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":"2025-01-26T13:16:35.743Z","updated_at":"2025-03-21T18:23:33.171Z","avatar_url":"https://github.com/firstclasspostcodes.png","language":"JavaScript","readme":"# Localstack\n\nWe use this library to help integrate [localstack](https://github.com/localstack/localstack) into our test suite.\n\n### Requirements\n\n- Docker\n- Docker Compose\n\n## Getting Started\n\nFirst install the library:\n\n```\nnpm i @firstclasspostcodes/localstack -D\n```\n\nAdd the following to a `jest.config.js` file:\n\n```js\nmodule.exports = {\n  // starts localstack when test execution begins\n  globalSetup: '@firstclasspostcodes/localstack/setup',\n  // optional: teardown localstack after tests complete\n  globalTeardown: '@firstclasspostcodes/localstack/teardown',\n  setupFiles: ['./jest.setup.js'],\n};\n```\n\nThis starts \u0026 stops localstack before \u0026 after test execution. We also **wait for localstack to be ready** before completing the setup.\n\nInside `jest.setup.js`, you'll want to include the following:\n\n```js\nconst AWS = require('aws-sdk');\nconst localstack = require('@firstclasspostcodes/localstack');\n\nlocalstack.configureSDKInstance(AWS);\n\nglobal.localstack = localstack;\n```\n\nUsing `global.localstack` allows you easy access to the following helpers:\n\n#### `createArtifactBucket()`\n\nCreates a shared artifact bucket, useful for uploading objects into. This returns the name of the bucket.\n\n#### `uploadArtifact(filepath)`\n\nUploads an artifact to the artifact bucket and takes care of deleting it before the process exits.\n\n#### `uploadDirectory(source)`\n\nPackages a directory as a ZIP archive and uploads it as an artifact to the artifact bucket.\n\n#### `deployLambda(source, params = {})`\n\nTakes a source directory (similar to `CodeUri`), archives it and creates a Lambda function.\n\n\u003e **Note:** The deployed lambda function has a wrapped handler, configuring the AWS SDK (running inside the Lambda function) to talk to localstack and not AWS. So no manual configuration of your functions is necessary.\n\n#### `invokeLambda(functionName, event = {})`\n\nInvokes the lambda with the provided name, returning the parsed JSON response.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstclasspostcodes%2Flocalstack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstclasspostcodes%2Flocalstack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstclasspostcodes%2Flocalstack/lists"}