JSFiddle - React, Tailwind, and code Playground

by yashsoni

HTML

<script src="https://npmcdn.com/redux/dist/redux.js"></script>
<script src="https://wzrd.in/standalone/expect@latest"></script>

Babel + JSX

const counter = () => {
 // ?
}

expect(
	counter(0, { type: 'INCREMENT' })
).toEqual(1);

expect(
	counter(1, { type: 'INCREMENT' })
).toEqual(2);

expect(
	counter(2, { type: 'DECREMENT' })
).toEqual(1);

expect(
	counter(undefined, {})
).toEqual(0);