This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{#if foo}} | |
Foo | |
{{elseif bar}} | |
Bar | |
{{else}} | |
neither | |
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/macku/jest-puppe-shots | |
const { mount } = require('jest-puppeshots'); | |
// 1. Sync API | |
test('should render <Foo> component', () => { | |
const wrapper = mount( | |
<MyComponent className="my-component"> | |
<strong>Hello World!</strong> | |
</MyComponent> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function transformer(file, api) { | |
const j = api.jscodeshift; | |
const root = j(file.source); | |
// Helpers | |
const wrapExpectExpression = expression => { | |
if (expression === null) { | |
return null; | |
} |