Skip to content

Instantly share code, notes, and snippets.

View macku's full-sized avatar
:bowtie:
NaN, null, undefined

Maciej Adamczak macku

:bowtie:
NaN, null, undefined
View GitHub Profile
@macku
macku / convert.js
Created November 10, 2019 21:41
A naive happy path QUnit to Jest jscodeshift converter
module.exports = function transformer(file, api) {
const j = api.jscodeshift;
const root = j(file.source);
// Helpers
const wrapExpectExpression = expression => {
if (expression === null) {
return null;
}
@macku
macku / test.jsx
Last active February 4, 2018 22:11
Jest Puppe Shots example
// 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>
{{#if foo}}
Foo
{{elseif bar}}
Bar
{{else}}
neither
{{/if}}