Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@eyedea/syncano-test

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eyedea/syncano-test

Testing scripts for @eyedea/syncano

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
4
Weekly downloads
 
Created
Source

@eyedea/syncano-test

Test solution for syncano socket based on @eyedea/syncano.

npm version license

Install

Install package in your socket directory:

$ npm install -D @eyedea/syncano-test

It is recommended to install this package as dev dependency, otherwise a lot of unnecessary packages will be deployed with socket.

Usage

  1. Create __tests__ directory in your socket. Add __tests__/tsconfig.json with the following content:
{
  "compilerOptions": {
    "lib": ["ES2015"]
  }
}
  1. Create your test file __tests__/ENDPOINT-NAME.test.js
import {run, stub, createSyncanoCoreMock} from '@eyedea/syncano'

describe('SOCKET/ENDPOINT-NAME', () => {
  it('should not fail', async () => {
    const meta = {user: undefined}
    const args = {id: 1}
    const mocks = createSyncanoCoreMock({
      data: {
        entity: {
          create: stub().resolves(args)
          fields: stub().fn({
            with: stub().fn({
              findOrFail: stub().resolves(args)
            })
          })
        }
      }
    })
    const result = await run('ENDPOINT-NAME', {args, meta}, {mocks})
    expect(result).toHaveProperty('data.id', args.id)
    expect(result).toHaveProperty('code', 200)
  })
})

License

MIT © Eyedea AS

Keywords

FAQs

Package last updated on 27 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc