Skip to content

Instantly share code, notes, and snippets.

import {shallow} from 'enzyme';
// '@types/jasmine-enzyme/index.d.ts' is not a module.
import jasmineEnzyme from 'jasmine-enzyme';
import * as React from 'react';
const MyComponent = () => (
<div>Foo</div>
);
describe('myComponent', () => {
class Demo extends LayoutTransitionGroup {
state = {
config: 0,
};
config = (i) => {
return () => {
// this is where the magic happens ✨
this.beginTransition((prevState) => ({
config: i,
class Demo extends React.Component {
state = {
switch: true,
};
toggle = () => {
this.setState((prevState) => ({
switch: !prevState.switch,
}));
};
/*
Credit to:
https://github.com/GoogleChrome/sw-toolbox/blob/master/lib/idb-cache-expiration.js
for ideas and initial code
*/
'use strict';
const DB_PREFIX = 'demo-cache-';
const DB_VERSION = 1;
const STORE_NAME = 'store';