Skip to content

Instantly share code, notes, and snippets.

View fakiolinho's full-sized avatar
🤘
Leading as usual...

Marios Fakiolas fakiolinho

🤘
Leading as usual...
View GitHub Profile
import React from 'react';
import { shallow } from 'enzyme';
import Options from './';
describe('test Options component', () => {
it('instance method handleAdd should be triggered when add button gets clicked', () => {
const enzymeWrapper = shallow(<Options />);
enzymeWrapper.instance().handleAdd = jest.fn();
import React, { Component } from 'react';
export default class Options extends Component {
handleAdd = () => {
console.log('add');
};
handleEdit = () => {
console.log('edit');
};
import React from 'react';
import { shallow } from 'enzyme';
import Options from './';
describe('test Options component', () => {
it('instance method handleAdd should be triggered when add button gets clicked', () => {
const enzymeWrapper = shallow(<Options />);
enzymeWrapper.instance().handleAdd = jest.fn();
import React, { Component } from 'react';
export default class Options extends Component {
handleAdd = () => {
console.log('add');
};
handleEdit = () => {
console.log('edit');
};
import React from 'react';
import { shallow } from 'enzyme';
import Card from './';
describe('test Card component', () => {
it('should render the component', () => {
const enzymeWrapper = shallow(<Card />);
expect(enzymeWrapper).toHaveLength(1);
import React from 'react';
import { shallow } from 'enzyme';
import Card from './';
describe('test Card component', () => {
it('should render the component', () => {
const enzymeWrapper = shallow(<Card />);
expect(enzymeWrapper).toHaveLength(1);
import React, { Component } from 'react';
import 'tachyons/css/tachyons.min.css';
export default class Card extends Component {
state = {
salute: false,
like: false,
};
const { resolve } = require('path');
module.exports = {
context: resolve(__dirname, '../'),
entry: ['babel-polyfill', './app/js/main.js'],
resolve: {
extensions: [
'*', '.js', '.jsx',
],
modules: [
"scripts": {
"development": "cross-env NODE_ENV=development env-cmd .env webpack-dev-server --config ./webpack",
"production": "cross-env NODE_ENV=production env-cmd .env webpack --config ./webpack",
"test": "cross-env NODE_ENV=test env-cmd .env jest --config ./jest.config.json"
}
import axios from 'axios';
const request = axios.create({
baseURL: process.env.API_URL
});
export default request;