Skip to content

Instantly share code, notes, and snippets.

View mayank23's full-sized avatar
💭
🏎

Mayank Jethva mayank23

💭
🏎
View GitHub Profile
@mayank23
mayank23 / README.md
Last active June 20, 2023 20:00
Jest Mock Any Property on Window Utility - with automatic cleanup

Jest Mock Any Property on Window Utility - with automatic cleanup.

@mayank23
mayank23 / bundle.js
Last active January 6, 2020 16:30
Basic Css Loader
(function(modules) {
function require(id) {
const [fn, mapping] = modules[id];
function localRequire(name) {
return require(mapping[name]);
}
const module = { exports : {} };
@mayank23
mayank23 / NewLines.jsx
Last active July 28, 2021 03:35
React New Lines ("\n") Example - babel / react / css (white space pre-wrap)
import React from 'react';
import { render } from 'react-dom';
import Hello from './Hello';
const styles = {
fontFamily: 'sans-serif',
textAlign: 'center',
};
const App = () => {
@mayank23
mayank23 / ActionTypeMatching.js
Last active June 30, 2020 22:24
Jest user defined asymmetric matchers
import * as actionTypes from './action-types.js';
class ActionTypeMatching extends AsymmetricMatcher {
constructor(expected){
this.$$typeof = Symbol.for('jest.asymmetricMatcher');
this.expected = expected;
}
asymmetricMatch(other) {