Skip to content

Instantly share code, notes, and snippets.

❤️
TypeScript - Node.js (/Nest) - React

Vincent G VinceOPS

Block or report user

Report or block VinceOPS

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
@VinceOPS
VinceOPS / wait-for-assertion.spec.ts
Last active Apr 29, 2019
Nest: testing (E2E) asynchronous side-effects with Jest and RxJs
View wait-for-assertion.spec.ts
import { TimeoutError } from 'rxjs';
import { waitForAssertion } from './wait-for-assertion';
describe('waitForAssertion', () => {
let mockWitness: jest.Mock;
beforeEach(() => {
mockWitness = jest.fn().mockReturnValue(false);
});
@VinceOPS
VinceOPS / inherit-validation.decorator.spec.ts
Last active Jan 10, 2019
Inherit validation metadata of another property, using class-validator
View inherit-validation.decorator.spec.ts
import { getFromContainer, IsDateString, IsEmail, IsNumber, IsOptional, IsString, Max, MaxLength, MetadataStorage, validate } from 'class-validator';
import { ValidationMetadata } from 'class-validator/metadata/ValidationMetadata';
import _ from 'lodash';
import { InheritValidation } from './inherit-validation.dtodep.decorator';
/**
* Used as a base for validation, in order for partial classes
* to pick validation metadatas, property by property.
*/
You can’t perform that action at this time.