Skip to content

Instantly share code, notes, and snippets.

@webschik
webschik / jest-component-template.jsx
Created December 30, 2018 20:27
WebStorm template for Jest component test
import {shallow} from 'enzyme';
import React from 'react';
describe('Components', () => {
describe(${COMPONENT_NAME}, () => {
it('should render itself [smoke test]', () => {
const props = {};
const wrapper = shallow(<${COMPONENT_NAME} {...props} />);
expect(wrapper).toMatchSnapshot();
@webschik
webschik / file2html-docx-sample.js
Last active July 31, 2018 11:22
Reading of the .docx file with file2html
/**
* Node.js v10.3.0+
*
* 1. npm i file2html-ooxml
* 2. Place test-file.docx file in the same folder with this script
*/
const fs = require('fs');
const file2html = require('file2html');
const OOXMLReader = require('file2html-ooxml').default;