All Projects → Patys → snap-it

Patys / snap-it

Licence: other
Tool to automatically create snapshot boilerplate tests for React Native.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to snap-it

React Native View Shot
Snapshot a React Native view and save it to an image
Stars: ✭ 1,960 (+16233.33%)
Mutual labels:  snapshot
Cloudexplorer
Cloud Explorer
Stars: ✭ 170 (+1316.67%)
Mutual labels:  snapshot
AppDynamics.DEXTER
Turn your APM data store into a Data Warehouse with advanced reporting, including entities, configuration, metrics, flowmaps, events, snapshots and call graph flame graphs
Stars: ✭ 79 (+558.33%)
Mutual labels:  snapshot
React Native Testing Example
Example of unit testing a React Native & Redux app using Jest (and Snapshots!)
Stars: ✭ 159 (+1225%)
Mutual labels:  snapshot
Knoxite
A data storage & backup system
Stars: ✭ 165 (+1275%)
Mutual labels:  snapshot
Launchscreensnapshot
Protects sensitive data in your app snapshot.
Stars: ✭ 209 (+1641.67%)
Mutual labels:  snapshot
Sanoid
Policy-driven snapshot management and replication tools. Using ZFS for underlying next-gen storage. (Btrfs support plans are shelved unless and until btrfs becomes reliable.) Primarily intended for Linux, but BSD use is supported and reasonably frequently tested.
Stars: ✭ 1,991 (+16491.67%)
Mutual labels:  snapshot
snapshot
Adds value / object / DOM element snapshot testing support to Cypress test runner
Stars: ✭ 114 (+850%)
Mutual labels:  snapshot
Snap Shot
Jest-like snapshot feature for the rest of us, works magically by finding the right caller function
Stars: ✭ 170 (+1316.67%)
Mutual labels:  snapshot
virt-backup
Fully backup your KVM Virtual Machines
Stars: ✭ 27 (+125%)
Mutual labels:  snapshot
Report Designer
🚀 打印设计、可视化、大屏、编辑器、设计器、数据分析、报表设计、组件化、表单设计、h5页面、调查问卷、pdf生成、流程图、试卷、SVG、图形元素、物联网
Stars: ✭ 160 (+1233.33%)
Mutual labels:  snapshot
Mmlpx
🐘 mobx model layer paradigm
Stars: ✭ 164 (+1266.67%)
Mutual labels:  snapshot
Verify
Verify is a snapshot tool that simplifies the assertion of complex data models and documents.
Stars: ✭ 210 (+1650%)
Mutual labels:  snapshot
Grub Btrfs
Include btrfs snapshots at boot options. (Grub menu)
Stars: ✭ 153 (+1175%)
Mutual labels:  snapshot
dify
A fast pixel-by-pixel image comparison tool in Rust
Stars: ✭ 41 (+241.67%)
Mutual labels:  snapshot
Android Snapshot Publisher
Gradle plugin to deploy Android Snapshot Versions
Stars: ✭ 145 (+1108.33%)
Mutual labels:  snapshot
Save Page State
A chrome extension to save the state of a page for further analysis
Stars: ✭ 208 (+1633.33%)
Mutual labels:  snapshot
room-glimpse
Read what your Raspberry Pi sees (picamera + Azure Cognitive / IoT)
Stars: ✭ 15 (+25%)
Mutual labels:  snapshot
GradleMavenPush
Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Central, Corporate staging/snapshot servers and local Maven repositories).
Stars: ✭ 21 (+75%)
Mutual labels:  snapshot
Jest Image Snapshot
✨ Jest matcher for image comparisons. Most commonly used for visual regression testing.
Stars: ✭ 2,940 (+24400%)
Mutual labels:  snapshot

snap-it

npm version

This is a tool to create a snapshot for your component. You can use it to simply generate boilerplate file with all cases. Keep in mind that you should verify and add your own test cases.

Works only with TypeScript for now.

Usage:

Follow instalation guide and then:

yarn create-snapshot components/Search.tsx

Or you can use it directly without installing:

npx @patys/snap-it g components/Search.tsx

To save in the same directory use option: --direct=true

npx @patys/snap-it g components/Search.tsx --direct=true

Effect with direct: components/Search.tsx components/Search.test.tsx

Effect without direct: components/Search.tsx __tests__/Search.test.tsx

Installation:

yarn add --dev @patys/snap-it

Add to your package.json

{
  "scripts": {
    ...
    "create-snapshot": "yarn snap-it g "
    ...
  }
}

Example:

Your component:

// example/Search.tsx
import React from 'react';
import { View } from 'react-native';

interface Props {
  numberTest?: number;
  booleanTest?: boolean;
  stringTest?: string;
  anyTest?: any;
  functionTest?: () => void;

  requiredTest: string;
}

export default function Search({}: Props) {
  return <View />;
}

Effect:

import React from 'react';
import { render } from '@testing-library/react-native';

import { Search } from '../example/Search.tsx';

describe('Search', () => {
  test('Snaphot for required props', () => {
    const props = {
      requiredTest: 'testing string',
    };
    const tree = render(<Search {...props} />).toJSON();
    expect(tree).toMatchSnapshot();
  });

  test('Snaphot for numberTest', () => {
    const props = {
      requiredTest: 'testing string',

      numberTest: 123,
    };
    const tree = render(<Search {...props} />).toJSON();
    expect(tree).toMatchSnapshot();
  });

  test('Snaphot for booleanTest', () => {
    const props = {
      requiredTest: 'testing string',

      booleanTest: true,
    };
    const tree = render(<Search {...props} />).toJSON();
    expect(tree).toMatchSnapshot();
  });

  test('Snaphot for stringTest', () => {
    const props = {
      requiredTest: 'testing string',

      stringTest: 'testing string',
    };
    const tree = render(<Search {...props} />).toJSON();
    expect(tree).toMatchSnapshot();
  });

  test('Snaphot for anyTest', () => {
    const props = {
      requiredTest: 'testing string',

      anyTest: {},
    };
    const tree = render(<Search {...props} />).toJSON();
    expect(tree).toMatchSnapshot();
  });

  test('Snaphot for functionTest', () => {
    const props = {
      requiredTest: 'testing string',

      functionTest: jest.fn(),
    };
    const tree = render(<Search {...props} />).toJSON();
    expect(tree).toMatchSnapshot();
  });
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].