{"id":26811419,"url":"https://github.com/eyedea-io/syncano-test","last_synced_at":"2025-03-30T01:38:37.346Z","repository":{"id":40783791,"uuid":"236072635","full_name":"eyedea-io/syncano-test","owner":"eyedea-io","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-05T05:40:13.000Z","size":1394,"stargazers_count":0,"open_issues_count":16,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-09T18:33:56.750Z","etag":null,"topics":["socket","syncano"],"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/eyedea-io.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":"2020-01-24T19:50:32.000Z","updated_at":"2020-01-27T10:33:09.000Z","dependencies_parsed_at":"2023-02-03T14:02:25.900Z","dependency_job_id":null,"html_url":"https://github.com/eyedea-io/syncano-test","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/eyedea-io%2Fsyncano-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedea-io%2Fsyncano-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedea-io%2Fsyncano-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedea-io%2Fsyncano-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eyedea-io","download_url":"https://codeload.github.com/eyedea-io/syncano-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246266276,"owners_count":20749754,"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":["socket","syncano"],"created_at":"2025-03-30T01:38:36.820Z","updated_at":"2025-03-30T01:38:37.337Z","avatar_url":"https://github.com/eyedea-io.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @eyedea/syncano-test\n\nTest solution for syncano socket based on [@eyedea/syncano](https://github.com/eyedea-io/syncano).\n\n[![npm version](https://img.shields.io/npm/v/@eyedea/syncano-test.svg)](https://www.npmjs.com/package/@eyedea/syncano-test)\n[![license](https://img.shields.io/npm/l/@eyedea/syncano-test)](https://github.com/eyedea-io/syncano-test/blob/master/LICENSE)\n\n## Install\n\nInstall package in your socket directory:\n\n```\n$ npm install -D @eyedea/syncano-test\n```\n\n\u003e It is recommended to install this package as dev dependency, otherwise a lot of unnecessary packages will be deployed with socket.\n\n## Usage\n\n1. Create `__tests__` directory in your socket. Add `__tests__/tsconfig.json` with the following content:\n\n```json\n{\n  \"compilerOptions\": {\n    \"lib\": [\"ES2015\"]\n  }\n}\n```\n\n2. Create your test file `__tests__/ENDPOINT-NAME.test.js`\n\n```tsx\nimport {run, stub, createSyncanoCoreMock} from '@eyedea/syncano'\n\ndescribe('SOCKET/ENDPOINT-NAME', () =\u003e {\n  it('should not fail', async () =\u003e {\n    const meta = {user: undefined}\n    const args = {id: 1}\n    const mocks = createSyncanoCoreMock({\n      data: {\n        entity: {\n          create: stub().resolves(args)\n          fields: stub().fn({\n            with: stub().fn({\n              findOrFail: stub().resolves(args)\n            })\n          })\n        }\n      }\n    })\n    const result = await run('ENDPOINT-NAME', {args, meta}, {mocks})\n    expect(result).toHaveProperty('data.id', args.id)\n    expect(result).toHaveProperty('code', 200)\n  })\n})\n```\n\n## License\n\nMIT © \u003ca href=\"https://eyedea.io\"\u003eEyedea AS\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyedea-io%2Fsyncano-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feyedea-io%2Fsyncano-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyedea-io%2Fsyncano-test/lists"}