UNPKG

goobs-testing

Version:

A robust testing toolkit for JavaScript and TypeScript projects, offering custom assertions, advanced mocking utilities, performance profiling, benchmarking tools, flexible logging options, and seamless integration with Jest and Husky for enhanced test-dr

104 lines (95 loc) 2.34 kB
// Assertions import { expectToBeWithinRange, expectToBeCloseToNow, expectToHaveBeenCalledOnceWith, expectToBeValidEmail, expectToBeNonEmptyString, expectToBePositiveNumber, expectToBeValidUUID, expectToHaveProperty, expectToBeEmptyArray, expectToBeNonEmptyArray, expectToBeTrue, expectToBeFalse, expectToBeNull, expectToBeUndefined, expectToBeNullOrUndefined, expectToThrowError, expectToBePromise, expectToBeDate, expectToBeSorted, expectToBeGreaterThan, wrapExpectToThrowError, } from './assertions'; // Mocking utilities import { mockPerformanceNow, realPerformanceNow, mockConsole, mockFetch, mockAsyncFunction, createMockEvent, mockLocalStorage, mockTimer, mockModule, mockEnvironment, } from './mock'; // Performance measurement import { measureAsyncExecutionTime, measureMultipleAsyncExecutionTimes, calculateExecutionTimeStats, measureAsyncExecutionTimeWithStats, } from './performance'; // Benchmark utilities import { benchmark, compareBenchmarks, formatBenchmarkResults, runBenchmarks } from './benchmark'; import { ClientLogger } from './logging/logger.client'; import { ServerLogger } from './logging/logger.server'; export { // Assertions expectToBeWithinRange, expectToBeCloseToNow, expectToHaveBeenCalledOnceWith, expectToBeValidEmail, expectToBeNonEmptyString, expectToBePositiveNumber, expectToBeValidUUID, expectToHaveProperty, expectToBeEmptyArray, expectToBeNonEmptyArray, expectToBeTrue, expectToBeFalse, expectToBeNull, expectToBeUndefined, expectToBeNullOrUndefined, expectToThrowError, expectToBePromise, expectToBeDate, expectToBeSorted, expectToBeGreaterThan, wrapExpectToThrowError, // Mocking utilities mockPerformanceNow, realPerformanceNow, mockConsole, mockFetch, mockAsyncFunction, createMockEvent, mockLocalStorage, mockTimer, mockModule, mockEnvironment, // Performance measurement measureAsyncExecutionTime, measureMultipleAsyncExecutionTimes, calculateExecutionTimeStats, measureAsyncExecutionTimeWithStats, // Benchmark utilities benchmark, compareBenchmarks, formatBenchmarkResults, runBenchmarks, ClientLogger, ServerLogger, };