Skip to content

Instantly share code, notes, and snippets.

View himanshuteotia's full-sized avatar
🎯
Focusing

Himanshu Teotia himanshuteotia

🎯
Focusing
View GitHub Profile
test('creates Contract on correct date', () => {
const NOW = '2019-05-03T08:00:00.000Z';
const mockDateNow = jest
.spyOn(global.Date, 'now')
.mockImplementation(() => new Date(NOW).getTime());
const mutation = `
mutation createContract {
createContract {
startedOn
@himanshuteotia
himanshuteotia / Create hot fix steps
Last active August 18, 2021 10:23
Create PR for hot fixes
You can follow this steps;
1. checkout to stage and ensure that you have the latest code
2. checkout to live and ensure you have the latest code
3. create a new branch from live , you can call it hot-fix-<simple name of the changes> e.g. "hot-fix-user-rb-api"
4. cherry-pick each of the commits you want from stage into the new branch you created (you can get the commit ids from the PR that contains the changes you want to hot fix)
5. Create a PR from the hot-fix branch -> live
Class Decorator
A class decorator is applied to the entire class and has a single parameter.
function classDecorator(target: Function) {
// target is the constructor function of the class
}
Method Decorator
A method decorator is applied to a method within a class and has three parameters.