Skip to content

Instantly share code, notes, and snippets.

{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "src/js/*.js'",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@thompsongl
thompsongl / enum.table.plugin.jsx
Created November 20, 2017 16:11
Customizing swagger-ui via plugins
import React from 'react';
import PropTypes from 'prop-types';
class EnumTable extends React.Component {
render() {
const {propVal} = this.props;
return (
<table className="c-codeTable">
<thead>
<tr><th>Code</th><th>Value</th><th>Description</th></tr>
@thompsongl
thompsongl / responsive.test.tsx
Created March 4, 2020 23:29
Jest testing a responsive component
import React from 'react';
import { mount } from 'enzyme';
import { act } from 'react-dom/test-utils';
import { Responsive } from './responsive';
const resizeWindow = (x: number, y: number) => {
// @ts-ignore
window.innerWidth = x;
// @ts-ignore