UNPKG

733 BJavaScriptView Raw
1module.exports = function(name, upper){
2
3return `
4import React from 'react';
5import { shallow, mount, render } from 'enzyme';
6import chai, { expec } from 'chai';
7
8chai.use(chaiEnzyme());
9
10import ${upper} from './${upper}';
11
12describe('${upper}', ()=> {
13 let ${name};
14
15 describe('with props set', ()=> {
16 let props = {/* add props here */};
17
18 beforeEach(()=>{
19 ${name} = mount(
20 <${upper} {...props} />
21 );
22 });
23
24 it('exists', ()=> {
25 expect(${name}).to.exist;
26 });
27
28 });
29
30 describe('with props not set', ()=> {
31 beforeEach(()=> {
32 ${name} = mount(
33 <${upper} />
34 );
35 });
36
37 });
38});
39`
40}
\No newline at end of file