CVarisco/create-component-app

View on GitHub
src/defaultTemplates/js/__tests__/test.template.test.js

Summary

Maintainability
A
0 mins
Test Coverage
import template from '../test.template'

describe('Test Template', () => {
  it('should a string', () => {
    expect(typeof template()).toBe('string')
  })

  it('should import component for story book', () => {
    expect(template('Foo')).toContain("import Foo from './Foo'")
  })

  it('should crate describe block with component name', () => {
    expect(template('Foo')).toContain("describe('Foo', () =>")
  })

  it('should render component for test in beforeEach block', () => {
    expect(template('Foo')).toContain('shallow(<Foo {...props} />)')
  })
})