Skip to content

Instantly share code, notes, and snippets.

Paul dagda1

Block or report user

Report or block dagda1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ts.ts
const obj = {
obj = {
chunkName() {
return \\"moment\\";
},
isReady(props) {
return __loadable_isReady__(this, props);
},
importAsync: (),
requireAsync(props) {
View eslintrc.js
module.exports = {
globals: {
MyGlobal: true,
},
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:jest/recommended',
'plugin:jest-formatting/recommended',
'prettier/@typescript-eslint',
View test.ts
test.each`
url | path | expected | message
${'/csg/product-selector'} | ${RoleDetailsUrl} | ${makeCsgUrl(RoleDetailsUrl)} | ${'should be csg url'}
${'/applicant/join/product-selector'} | ${ProductSelector} | ${makeApplicantJoinUrl(ProductSelector)} | ${'should be applicant url'}
${'/applicant/existing/current-name'} | ${CurrentName} | ${makeApplicantExistingUrl(CurrentName)} | ${'should be applicant url'}
${'/personal-employer/join/details'} | ${PERoleDetailsUrl} | ${makePersonalEmployerJoinUrl(PERoleDetailsUrl)} | ${'should be personal employer url'}
`('url:$url is is $expected, // $message ', ({ url, expected }) => {
history.push(url);
const {
View mock.ts
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useHistory: () => history,
}));
View mock.ts
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useHistory: () => history,
}));
View mock.ts
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useHistory: () => history,
}));
View mock.ts
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useHistory: () => history,
}));
View mock.ts
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useHistory: () => history,
}));
View t.ts
type TransformerFunc<T> = (src: T) => any;
export type TransformerMap<S> = {
[P in keyof S]?:
| S[P]
| TransformerFunc<S>
| TransformerFunc<S[P]>
| TransformerActions
| TransformerMap<S[P]>;
};
View infer.ts
export type ComponentPropsType<C> = C extends React.FC<infer P> ? P : never;
export type ThenType<T> = T extends Promise<infer U> ? U : never;
You can’t perform that action at this time.