Skip to content

Instantly share code, notes, and snippets.

View muscaiu's full-sized avatar
🎯
Focusing

Cristian Muscalu muscaiu

🎯
Focusing
View GitHub Profile
run clean-env
{"lastUpload":"2020-02-25T06:12:54.814Z","extensionVersion":"v3.4.3"}
const { sortBy, orderBy } = require('lodash');
const filteredGames = [
{ name: 'game2', discountActive: 1, price: 5, priceDiscounted: 4 },
{ name: 'game6', discountActive: 1, price: 20, priceDiscounted: 8 },
{ name: 'game5', discountActive: 0, price: 10, priceDiscounted: 9 },
{ name: 'game3', discountActive: 0, price: 11, priceDiscounted: 10 },
{ name: 'game4', discountActive: 1, price: 22, priceDiscounted: 17 },
{ name: 'game1', discountActive: 0, price: 21, priceDiscounted: 18 },
];
sudo -i -u couchdb /home/couchdb/bin/couchdb
node node_modules\eslint\bin\eslint.js --fix app/**
create an empty firebase-messaging-sw.js inside the public folder
//go back as manny commits as you need
git reset --soft HEAD~4
git commit
git push --force origin my_branch
import React from 'react';
import createItem from '../createItem';
import { connect } from 'react-redux';
import { selectItem } from '../../selectors/itemSelectors';
jest.resetModules();
jest.mock('react-redux');
const WrappedComponent = () => (<li />);
let mapStateToProps;
import fetchData from './Api';
describe('API Caller', () => {
it('should call YesNo API', () => {
const fetchSpy = jest.spyOn(global, 'fetch')
.mockImplementation(() => Promise.resolve({
json: () => {},
}));
return fetchData()
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
export default (async function showResults(values) {
await sleep(500); // simulate server latency
window.alert(`You submitted:\n\n${JSON.stringify(values, null, 2)}`);
});