
|Report|Passed|Failed|Skipped|Time|
|:---|---:|---:|---:|---:|
|[fixtures/external/jest/jest-test-results.xml](#user-content-r0)|4207 ✅|2 ❌|30 ⚪|166s|
## ❌ fixtures/external/jest/jest-test-results.xml
**4239** tests were completed in **166s** with **4207** passed, **2** failed and **30** skipped.
|Test suite|Passed|Failed|Skipped|Time|
|:---|---:|---:|---:|---:|
|[e2e/__tests__/asyncAndCallback.test.ts](#user-content-r0s0)|1 ✅|||746ms|
|[e2e/__tests__/asyncRegenerator.test.ts](#user-content-r0s1)|1 ✅|||4s|
|[e2e/__tests__/autoClearMocks.test.ts](#user-content-r0s2)|2 ✅|||2s|
|[e2e/__tests__/autoResetMocks.test.ts](#user-content-r0s3)|2 ✅|||2s|
|[e2e/__tests__/autoRestoreMocks.test.ts](#user-content-r0s4)|2 ✅|||2s|
|[e2e/__tests__/babelPluginJestHoist.test.ts](#user-content-r0s5)|1 ✅|||6s|
|[e2e/__tests__/badSourceMap.test.ts](#user-content-r0s6)|1 ✅|||858ms|
|[e2e/__tests__/beforeAllFiltered.ts](#user-content-r0s7)|1 ✅|||958ms|
|[e2e/__tests__/beforeEachQueue.ts](#user-content-r0s8)|1 ✅||1 ⚪|55ms|
|[e2e/__tests__/callDoneTwice.test.ts](#user-content-r0s9)|1 ✅|||882ms|
|[e2e/__tests__/chaiAssertionLibrary.ts](#user-content-r0s10)|1 ✅|||2s|
|[e2e/__tests__/circularInequality.test.ts](#user-content-r0s11)|1 ✅|||1s|
|[e2e/__tests__/circusConcurrentEach.test.ts](#user-content-r0s12)|2 ✅|||2s|
|[e2e/__tests__/circusDeclarationErrors.test.ts](#user-content-r0s13)|1 ✅|||869ms|
|[e2e/__tests__/clearCache.test.ts](#user-content-r0s14)|2 ✅|||1s|
|[e2e/__tests__/cliHandlesExactFilenames.test.ts](#user-content-r0s15)|2 ✅|||1s|
|[e2e/__tests__/compareDomNodes.test.ts](#user-content-r0s16)|1 ✅|||1s|
|[e2e/__tests__/config.test.ts](#user-content-r0s17)|6 ✅|||4s|
|[e2e/__tests__/console.test.ts](#user-content-r0s18)|7 ✅|||8s|
|[e2e/__tests__/consoleAfterTeardown.test.ts](#user-content-r0s19)|1 ✅|||1s|
|[e2e/__tests__/consoleLogOutputWhenRunInBand.test.ts](#user-content-r0s20)|1 ✅|||793ms|
|[e2e/__tests__/coverageHandlebars.test.ts](#user-content-r0s21)|1 ✅|||2s|
|[e2e/__tests__/coverageRemapping.test.ts](#user-content-r0s22)|1 ✅|||13s|
|[e2e/__tests__/coverageReport.test.ts](#user-content-r0s23)|12 ✅|||22s|
|[e2e/__tests__/coverageThreshold.test.ts](#user-content-r0s24)|5 ✅|||5s|
|[e2e/__tests__/coverageTransformInstrumented.test.ts](#user-content-r0s25)|1 ✅|||5s|
|[e2e/__tests__/coverageWithoutTransform.test.ts](#user-content-r0s26)|1 ✅|||1s|
|[e2e/__tests__/createProcessObject.test.ts](#user-content-r0s27)|1 ✅|||908ms|
|[e2e/__tests__/customInlineSnapshotMatchers.test.ts](#user-content-r0s28)|1 ✅|||2s|
|[e2e/__tests__/customMatcherStackTrace.test.ts](#user-content-r0s29)|2 ✅|||2s|
|[e2e/__tests__/customReporters.test.ts](#user-content-r0s30)|9 ✅|||7s|
|[e2e/__tests__/customResolver.test.ts](#user-content-r0s31)|1 ✅|||826ms|
|[e2e/__tests__/customTestSequencers.test.ts](#user-content-r0s32)|3 ✅|||3s|
|[e2e/__tests__/debug.test.ts](#user-content-r0s33)|1 ✅|||899ms|
|[e2e/__tests__/declarationErrors.test.ts](#user-content-r0s34)|3 ✅|||2s|
|[e2e/__tests__/dependencyClash.test.ts](#user-content-r0s35)|1 ✅|||833ms|
|[e2e/__tests__/detectOpenHandles.ts](#user-content-r0s36)|8 ✅|||8s|
|[e2e/__tests__/domDiffing.test.ts](#user-content-r0s37)|1 ✅|||1s|
|[e2e/__tests__/doneInHooks.test.ts](#user-content-r0s38)|1 ✅|||855ms|
|[e2e/__tests__/dynamicRequireDependencies.ts](#user-content-r0s39)|1 ✅|||847ms|
|[e2e/__tests__/each.test.ts](#user-content-r0s40)|7 ✅|||5s|
|[e2e/__tests__/emptyDescribeWithHooks.test.ts](#user-content-r0s41)|4 ✅|||3s|
|[e2e/__tests__/emptySuiteError.test.ts](#user-content-r0s42)|1 ✅|||885ms|
|[e2e/__tests__/env.test.ts](#user-content-r0s43)|6 ✅|||5s|
|[e2e/__tests__/environmentAfterTeardown.test.ts](#user-content-r0s44)|1 ✅|||892ms|
|[e2e/__tests__/errorOnDeprecated.test.ts](#user-content-r0s45)|1 ✅||24 ⚪|56ms|
|[e2e/__tests__/esmConfigFile.test.ts](#user-content-r0s46)|3 ✅|||526ms|
|[e2e/__tests__/executeTestsOnceInMpr.ts](#user-content-r0s47)|1 ✅|||976ms|
|[e2e/__tests__/existentRoots.test.ts](#user-content-r0s48)|4 ✅|||627ms|
|[e2e/__tests__/expectAsyncMatcher.test.ts](#user-content-r0s49)|2 ✅|||3s|
|[e2e/__tests__/expectInVm.test.ts](#user-content-r0s50)|1 ✅|||2s|
|[e2e/__tests__/extraGlobals.test.ts](#user-content-r0s51)|1 ✅|||1s|
|[e2e/__tests__/failureDetailsProperty.test.ts](#user-content-r0s52)|1 ✅|||907ms|
|[e2e/__tests__/failures.test.ts](#user-content-r0s53)|7 ✅|||10s|
|[e2e/__tests__/fakePromises.test.ts](#user-content-r0s54)|2 ✅|||2s|
|[e2e/__tests__/fatalWorkerError.test.ts](#user-content-r0s55)|1 ✅|||3s|
|[e2e/__tests__/filter.test.ts](#user-content-r0s56)|7 ✅|||5s|
|[e2e/__tests__/findRelatedFiles.test.ts](#user-content-r0s57)|5 ✅|||6s|
|[e2e/__tests__/focusedTests.test.ts](#user-content-r0s58)|1 ✅|||888ms|
|[e2e/__tests__/forceExit.test.ts](#user-content-r0s59)|1 ✅|||2s|
|[e2e/__tests__/generatorMock.test.ts](#user-content-r0s60)|1 ✅|||1s|
|[e2e/__tests__/global-mutation.test.ts](#user-content-r0s61)|1 ✅|||40ms|
|[e2e/__tests__/global.test.ts](#user-content-r0s62)|1 ✅|||31ms|
|[e2e/__tests__/globals.test.ts](#user-content-r0s63)|10 ✅|||8s|
|[e2e/__tests__/globalSetup.test.ts](#user-content-r0s64)|10 ✅|||14s|
|[e2e/__tests__/globalTeardown.test.ts](#user-content-r0s65)|7 ✅|||12s|
|[e2e/__tests__/hasteMapMockChanged.test.ts](#user-content-r0s66)|1 ✅|||379ms|
|[e2e/__tests__/hasteMapSha1.test.ts](#user-content-r0s67)|1 ✅|||298ms|
|[e2e/__tests__/hasteMapSize.test.ts](#user-content-r0s68)|2 ✅|||397ms|
|[e2e/__tests__/importedGlobals.test.ts](#user-content-r0s69)|1 ✅|||1s|
|[e2e/__tests__/injectGlobals.test.ts](#user-content-r0s70)|2 ✅|||2s|
|[e2e/__tests__/jasmineAsync.test.ts](#user-content-r0s71)|15 ✅|||28s|
|[e2e/__tests__/jasmineAsyncWithPendingDuringTest.ts](#user-content-r0s72)|1 ✅||1 ⚪|72ms|
|[e2e/__tests__/jest.config.js.test.ts](#user-content-r0s73)|3 ✅|||2s|
|[e2e/__tests__/jest.config.ts.test.ts](#user-content-r0s74)|5 ✅|||14s|
|[e2e/__tests__/jestChangedFiles.test.ts](#user-content-r0s75)|9 ✅|1 ❌||9s|
|[e2e/__tests__/jestEnvironmentJsdom.test.ts](#user-content-r0s76)|1 ✅|||2s|
|[e2e/__tests__/jestRequireActual.test.ts](#user-content-r0s77)|1 ✅|||2s|
|[e2e/__tests__/jestRequireMock.test.ts](#user-content-r0s78)|1 ✅|||2s|
|[e2e/__tests__/json.test.ts](#user-content-r0s79)|2 ✅|||29ms|
|[e2e/__tests__/jsonReporter.test.ts](#user-content-r0s80)|2 ✅|||2s|
|[e2e/__tests__/lifecycles.ts](#user-content-r0s81)|1 ✅|||861ms|
|[e2e/__tests__/listTests.test.ts](#user-content-r0s82)|2 ✅|||945ms|
|[e2e/__tests__/locationInResults.test.ts](#user-content-r0s83)|2 ✅|||2s|
|[e2e/__tests__/logHeapUsage.test.ts](#user-content-r0s84)|1 ✅|||884ms|
|[e2e/__tests__/mockNames.test.ts](#user-content-r0s85)|8 ✅|||7s|
|[e2e/__tests__/modernFakeTimers.test.ts](#user-content-r0s86)|2 ✅|||2s|
|[e2e/__tests__/moduleNameMapper.test.ts](#user-content-r0s87)|5 ✅|||5s|
|[e2e/__tests__/moduleParentNullInTest.ts](#user-content-r0s88)|1 ✅|||886ms|
|[e2e/__tests__/multiProjectRunner.test.ts](#user-content-r0s89)|14 ✅|||16s|
|[e2e/__tests__/nativeAsyncMock.test.ts](#user-content-r0s90)|1 ✅|||55ms|
|[e2e/__tests__/nativeEsm.test.ts](#user-content-r0s91)|2 ✅||1 ⚪|905ms|
|[e2e/__tests__/nativeEsmTypescript.test.ts](#user-content-r0s92)|1 ✅|||956ms|
|[e2e/__tests__/nestedEventLoop.test.ts](#user-content-r0s93)|1 ✅|||1s|
|[e2e/__tests__/nestedTestDefinitions.test.ts](#user-content-r0s94)|4 ✅|||5s|
|[e2e/__tests__/nodePath.test.ts](#user-content-r0s95)|1 ✅|||866ms|
|[e2e/__tests__/noTestFound.test.ts](#user-content-r0s96)|2 ✅|||1s|
|[e2e/__tests__/noTestsFound.test.ts](#user-content-r0s97)|5 ✅|||3s|
|[e2e/__tests__/onlyChanged.test.ts](#user-content-r0s98)|8 ✅|1 ❌||22s|
|[e2e/__tests__/onlyFailuresNonWatch.test.ts](#user-content-r0s99)|1 ✅|||3s|
|[e2e/__tests__/overrideGlobals.test.ts](#user-content-r0s100)|2 ✅|||2s|
|[e2e/__tests__/pnp.test.ts](#user-content-r0s101)|1 ✅|||3s|
|[e2e/__tests__/presets.test.ts](#user-content-r0s102)|2 ✅|||2s|
|[e2e/__tests__/processExit.test.ts](#user-content-r0s103)|1 ✅|||1s|
|[e2e/__tests__/promiseReject.test.ts](#user-content-r0s104)|1 ✅|||967ms|
|[e2e/__tests__/regexCharInPath.test.ts](#user-content-r0s105)|1 ✅|||962ms|
|[e2e/__tests__/requireAfterTeardown.test.ts](#user-content-r0s106)|1 ✅|||921ms|
|[e2e/__tests__/requireMain.test.ts](#user-content-r0s107)|1 ✅|||1s|
|[e2e/__tests__/requireMainAfterCreateRequire.test.ts](#user-content-r0s108)|1 ✅|||966ms|
|[e2e/__tests__/requireMainIsolateModules.test.ts](#user-content-r0s109)|1 ✅|||976ms|
|[e2e/__tests__/requireMainResetModules.test.ts](#user-content-r0s110)|2 ✅|||2s|
|[e2e/__tests__/requireV8Module.test.ts](#user-content-r0s111)|1 ✅|||30ms|
|[e2e/__tests__/resetModules.test.ts](#user-content-r0s112)|1 ✅|||926ms|
|[e2e/__tests__/resolve.test.ts](#user-content-r0s113)|1 ✅|||2s|
|[e2e/__tests__/resolveGetPaths.test.ts](#user-content-r0s114)|1 ✅|||1s|
|[e2e/__tests__/resolveNodeModule.test.ts](#user-content-r0s115)|1 ✅|||943ms|
|[e2e/__tests__/resolveNoFileExtensions.test.ts](#user-content-r0s116)|2 ✅|||1s|
|[e2e/__tests__/resolveWithPaths.test.ts](#user-content-r0s117)|1 ✅|||1s|
|[e2e/__tests__/runProgrammatically.test.ts](#user-content-r0s118)|2 ✅|||575ms|
|[e2e/__tests__/runTestsByPath.test.ts](#user-content-r0s119)|1 ✅|||2s|
|[e2e/__tests__/runtimeInternalModuleRegistry.test.ts](#user-content-r0s120)|1 ✅|||1s|
|[e2e/__tests__/selectProjects.test.ts](#user-content-r0s121)|18 ✅|||5s|
|[e2e/__tests__/setImmediate.test.ts](#user-content-r0s122)|1 ✅|||904ms|
|[e2e/__tests__/setupFilesAfterEnvConfig.test.ts](#user-content-r0s123)|2 ✅|||2s|
|[e2e/__tests__/showConfig.test.ts](#user-content-r0s124)|1 ✅|||195ms|
|[e2e/__tests__/skipBeforeAfterAll.test.ts](#user-content-r0s125)|1 ✅|||1s|
|[e2e/__tests__/snapshot-unknown.test.ts](#user-content-r0s126)|1 ✅|||838ms|
|[e2e/__tests__/snapshot.test.ts](#user-content-r0s127)|9 ✅|||14s|
|[e2e/__tests__/snapshotMockFs.test.ts](#user-content-r0s128)|1 ✅|||883ms|
|[e2e/__tests__/snapshotResolver.test.ts](#user-content-r0s129)|1 ✅|||823ms|
|[e2e/__tests__/snapshotSerializers.test.ts](#user-content-r0s130)|2 ✅|||2s|
|[e2e/__tests__/stackTrace.test.ts](#user-content-r0s131)|7 ✅|||5s|
|[e2e/__tests__/stackTraceNoCaptureStackTrace.test.ts](#user-content-r0s132)|1 ✅|||899ms|
|[e2e/__tests__/stackTraceSourceMaps.test.ts](#user-content-r0s133)|1 ✅|||2s|
|[e2e/__tests__/stackTraceSourceMapsWithCoverage.test.ts](#user-content-r0s134)|1 ✅|||2s|
|[e2e/__tests__/supportsDashedArgs.ts](#user-content-r0s135)|2 ✅|||968ms|
|[e2e/__tests__/symbol.test.ts](#user-content-r0s136)|1 ✅|||49ms|
|[e2e/__tests__/testEnvironment.test.ts](#user-content-r0s137)|1 ✅|||2s|
|[e2e/__tests__/testEnvironmentAsync.test.ts](#user-content-r0s138)|1 ✅|||1s|
|[e2e/__tests__/testEnvironmentCircus.test.ts](#user-content-r0s139)|1 ✅|||2s|
|[e2e/__tests__/testEnvironmentCircusAsync.test.ts](#user-content-r0s140)|1 ✅|||2s|
|[e2e/__tests__/testFailureExitCode.test.ts](#user-content-r0s141)|2 ✅|||4s|
|[e2e/__tests__/testInRoot.test.ts](#user-content-r0s142)|1 ✅|||1s|
|[e2e/__tests__/testNamePattern.test.ts](#user-content-r0s143)|1 ✅|||859ms|
|[e2e/__tests__/testNamePatternSkipped.test.ts](#user-content-r0s144)|1 ✅|||991ms|
|[e2e/__tests__/testPathPatternReporterMessage.test.ts](#user-content-r0s145)|1 ✅|||3s|
|[e2e/__tests__/testResultsProcessor.test.ts](#user-content-r0s146)|1 ✅|||910ms|
|[e2e/__tests__/testRetries.test.ts](#user-content-r0s147)|4 ✅|||3s|
|[e2e/__tests__/testTodo.test.ts](#user-content-r0s148)|5 ✅|||4s|
|[e2e/__tests__/timeouts.test.ts](#user-content-r0s149)|4 ✅|||4s|
|[e2e/__tests__/timeoutsLegacy.test.ts](#user-content-r0s150)|1 ✅||3 ⚪|71ms|
|[e2e/__tests__/timerResetMocks.test.ts](#user-content-r0s151)|2 ✅|||2s|
|[e2e/__tests__/timerUseRealTimers.test.ts](#user-content-r0s152)|1 ✅|||1s|
|[e2e/__tests__/toMatchInlineSnapshot.test.ts](#user-content-r0s153)|12 ✅|||24s|
|[e2e/__tests__/toMatchInlineSnapshotWithRetries.test.ts](#user-content-r0s154)|3 ✅|||5s|
|[e2e/__tests__/toMatchSnapshot.test.ts](#user-content-r0s155)|9 ✅|||17s|
|[e2e/__tests__/toMatchSnapshotWithRetries.test.ts](#user-content-r0s156)|2 ✅|||4s|
|[e2e/__tests__/toMatchSnapshotWithStringSerializer.test.ts](#user-content-r0s157)|3 ✅|||4s|
|[e2e/__tests__/toThrowErrorMatchingInlineSnapshot.test.ts](#user-content-r0s158)|4 ✅|||4s|
|[e2e/__tests__/toThrowErrorMatchingSnapshot.test.ts](#user-content-r0s159)|5 ✅|||4s|
|[e2e/__tests__/transform.test.ts](#user-content-r0s160)|16 ✅|||27s|
|[e2e/__tests__/transformLinkedModules.test.ts](#user-content-r0s161)|1 ✅|||783ms|
|[e2e/__tests__/typescriptCoverage.test.ts](#user-content-r0s162)|1 ✅|||3s|
|[e2e/__tests__/unexpectedToken.test.ts](#user-content-r0s163)|3 ✅|||3s|
|[e2e/__tests__/useStderr.test.ts](#user-content-r0s164)|1 ✅|||1s|
|[e2e/__tests__/v8Coverage.test.ts](#user-content-r0s165)|2 ✅|||2s|
|[e2e/__tests__/verbose.test.ts](#user-content-r0s166)|1 ✅|||683ms|
|[e2e/__tests__/version.test.ts](#user-content-r0s167)|1 ✅|||138ms|
|[e2e/__tests__/watchModeNoAccess.test.ts](#user-content-r0s168)|1 ✅|||4s|
|[e2e/__tests__/watchModeOnlyFailed.test.ts](#user-content-r0s169)|1 ✅|||1s|
|[e2e/__tests__/watchModePatterns.test.ts](#user-content-r0s170)|2 ✅|||4s|
|[e2e/__tests__/watchModeUpdateSnapshot.test.ts](#user-content-r0s171)|1 ✅|||1s|
|[e2e/__tests__/workerForceExit.test.ts](#user-content-r0s172)|2 ✅|||5s|
|[e2e/__tests__/wrongEnv.test.ts](#user-content-r0s173)|5 ✅|||4s|
|[e2e/custom-test-sequencer/a.test.js](#user-content-r0s174)|1 ✅|||29ms|
|[e2e/custom-test-sequencer/b.test.js](#user-content-r0s175)|1 ✅|||21ms|
|[e2e/custom-test-sequencer/c.test.js](#user-content-r0s176)|1 ✅|||42ms|
|[e2e/custom-test-sequencer/d.test.js](#user-content-r0s177)|1 ✅|||21ms|
|[e2e/custom-test-sequencer/e.test.js](#user-content-r0s178)|1 ✅|||27ms|
|[e2e/test-in-root/spec.js](#user-content-r0s179)|1 ✅|||19ms|
|[e2e/test-in-root/test.js](#user-content-r0s180)|1 ✅|||37ms|
|[e2e/timer-reset-mocks/after-reset-all-mocks/timerAndMock.test.js](#user-content-r0s181)|2 ✅|||30ms|
|[e2e/timer-reset-mocks/with-reset-mocks/timerWithMock.test.js](#user-content-r0s182)|1 ✅|||34ms|
|[e2e/v8-coverage/empty-sourcemap/test.ts](#user-content-r0s183)|1 ✅|||31ms|
|[examples/angular/app.component.spec.ts](#user-content-r0s184)|3 ✅|||654ms|
|[examples/angular/shared/data.service.spec.ts](#user-content-r0s185)|2 ✅|||431ms|
|[examples/angular/shared/sub.service.spec.ts](#user-content-r0s186)|1 ✅|||109ms|
|[examples/async/__tests__/user.test.js](#user-content-r0s187)|8 ✅|||96ms|
|[examples/automatic-mocks/__tests__/automock.test.js](#user-content-r0s188)|2 ✅|||74ms|
|[examples/automatic-mocks/__tests__/createMockFromModule.test.js](#user-content-r0s189)|2 ✅|||115ms|
|[examples/automatic-mocks/__tests__/disableAutomocking.test.js](#user-content-r0s190)|1 ✅|||24ms|
|[examples/enzyme/__tests__/CheckboxWithLabel-test.js](#user-content-r0s191)|1 ✅|||434ms|
|[examples/getting-started/sum.test.js](#user-content-r0s192)|1 ✅|||78ms|
|[examples/jquery/__tests__/display_user.test.js](#user-content-r0s193)|1 ✅|||196ms|
|[examples/jquery/__tests__/fetch_current_user.test.js](#user-content-r0s194)|2 ✅|||196ms|
|[examples/manual-mocks/__tests__/file_summarizer.test.js](#user-content-r0s195)|1 ✅|||87ms|
|[examples/manual-mocks/__tests__/lodashMocking.test.js](#user-content-r0s196)|1 ✅|||109ms|
|[examples/manual-mocks/__tests__/user.test.js](#user-content-r0s197)|1 ✅|||41ms|
|[examples/manual-mocks/__tests__/userMocked.test.js](#user-content-r0s198)|1 ✅|||105ms|
|[examples/module-mock/__tests__/full_mock.js](#user-content-r0s199)|1 ✅|||60ms|
|[examples/module-mock/__tests__/mock_per_test.js](#user-content-r0s200)|2 ✅|||116ms|
|[examples/module-mock/__tests__/partial_mock.js](#user-content-r0s201)|1 ✅|||215ms|
|[examples/mongodb/__test__/db.test.js](#user-content-r0s202)|1 ✅|||236ms|
|[examples/react-native/__tests__/intro.test.js](#user-content-r0s203)|4 ✅|||9s|
|[examples/react-testing-library/__tests__/CheckboxWithLabel-test.js](#user-content-r0s204)|1 ✅|||469ms|
|[examples/react/__tests__/CheckboxWithLabel-test.js](#user-content-r0s205)|1 ✅|||256ms|
|[examples/snapshot/__tests__/clock.react.test.js](#user-content-r0s206)|1 ✅|||62ms|
|[examples/snapshot/__tests__/link.react.test.js](#user-content-r0s207)|4 ✅|||181ms|
|[examples/timer/__tests__/infinite_timer_game.test.js](#user-content-r0s208)|1 ✅|||94ms|
|[examples/timer/__tests__/timer_game.test.js](#user-content-r0s209)|3 ✅|||74ms|
|[examples/typescript/__tests__/calc.test.ts](#user-content-r0s210)|6 ✅|||276ms|
|[examples/typescript/__tests__/CheckboxWithLabel-test.tsx](#user-content-r0s211)|1 ✅|||227ms|
|[examples/typescript/__tests__/sub-test.ts](#user-content-r0s212)|1 ✅|||43ms|
|[examples/typescript/__tests__/sum-test.ts](#user-content-r0s213)|2 ✅|||69ms|
|[examples/typescript/__tests__/sum.test.js](#user-content-r0s214)|2 ✅|||100ms|
|[packages/babel-jest/src/__tests__/index.ts](#user-content-r0s215)|6 ✅|||371ms|
|[packages/babel-plugin-jest-hoist/src/__tests__/hoistPlugin.test.ts](#user-content-r0s216)|4 ✅|||347ms|
|[packages/diff-sequences/src/__tests__/index.property.test.ts](#user-content-r0s217)|7 ✅|||357ms|
|[packages/diff-sequences/src/__tests__/index.test.ts](#user-content-r0s218)|48 ✅|||195ms|
|[packages/expect/src/__tests__/assertionCounts.test.ts](#user-content-r0s219)|6 ✅|||60ms|
|[packages/expect/src/__tests__/asymmetricMatchers.test.ts](#user-content-r0s220)|38 ✅|||207ms|
|[packages/expect/src/__tests__/extend.test.ts](#user-content-r0s221)|10 ✅|||99ms|
|[packages/expect/src/__tests__/isError.test.ts](#user-content-r0s222)|4 ✅|||43ms|
|[packages/expect/src/__tests__/matchers-toContain.property.test.ts](#user-content-r0s223)|2 ✅|||236ms|
|[packages/expect/src/__tests__/matchers-toContainEqual.property.test.ts](#user-content-r0s224)|2 ✅|||287ms|
|[packages/expect/src/__tests__/matchers-toEqual.property.test.ts](#user-content-r0s225)|2 ✅|||1s|
|[packages/expect/src/__tests__/matchers-toStrictEqual.property.test.ts](#user-content-r0s226)|3 ✅|||394ms|
|[packages/expect/src/__tests__/matchers.test.js](#user-content-r0s227)|592 ✅|||862ms|
|[packages/expect/src/__tests__/spyMatchers.test.ts](#user-content-r0s228)|248 ✅|||395ms|
|[packages/expect/src/__tests__/stacktrace.test.ts](#user-content-r0s229)|3 ✅|||69ms|
|[packages/expect/src/__tests__/symbolInObjects.test.ts](#user-content-r0s230)|3 ✅|||33ms|
|[packages/expect/src/__tests__/toEqual-dom.test.ts](#user-content-r0s231)|12 ✅|||99ms|
|[packages/expect/src/__tests__/toThrowMatchers.test.ts](#user-content-r0s232)|98 ✅|||257ms|
|[packages/expect/src/__tests__/utils.test.ts](#user-content-r0s233)|41 ✅|||147ms|
|[packages/jest-circus/src/__tests__/afterAll.test.ts](#user-content-r0s234)|6 ✅|||6s|
|[packages/jest-circus/src/__tests__/baseTest.test.ts](#user-content-r0s235)|2 ✅|||3s|
|[packages/jest-circus/src/__tests__/circusItTestError.test.ts](#user-content-r0s236)|8 ✅|||300ms|
|[packages/jest-circus/src/__tests__/circusItTodoTestError.test.ts](#user-content-r0s237)|3 ✅|||81ms|
|[packages/jest-circus/src/__tests__/hooks.test.ts](#user-content-r0s238)|3 ✅|||4s|
|[packages/jest-circus/src/__tests__/hooksError.test.ts](#user-content-r0s239)|32 ✅|||127ms|
|[packages/jest-cli/src/__tests__/cli/args.test.ts](#user-content-r0s240)|17 ✅|||345ms|
|[packages/jest-cli/src/init/__tests__/init.test.js](#user-content-r0s241)|24 ✅|||119ms|
|[packages/jest-cli/src/init/__tests__/modifyPackageJson.test.ts](#user-content-r0s242)|4 ✅|||30ms|
|[packages/jest-config/src/__tests__/Defaults.test.ts](#user-content-r0s243)|1 ✅|||672ms|
|[packages/jest-config/src/__tests__/getMaxWorkers.test.ts](#user-content-r0s244)|7 ✅|||67ms|
|[packages/jest-config/src/__tests__/normalize.test.js](#user-content-r0s245)|118 ✅|||798ms|
|[packages/jest-config/src/__tests__/readConfig.test.ts](#user-content-r0s246)|1 ✅|||76ms|
|[packages/jest-config/src/__tests__/readConfigs.test.ts](#user-content-r0s247)|3 ✅|||135ms|
|[packages/jest-config/src/__tests__/resolveConfigPath.test.ts](#user-content-r0s248)|10 ✅|||183ms|
|[packages/jest-config/src/__tests__/setFromArgv.test.ts](#user-content-r0s249)|4 ✅|||53ms|
|[packages/jest-config/src/__tests__/validatePattern.test.ts](#user-content-r0s250)|4 ✅|||52ms|
|[packages/jest-console/src/__tests__/bufferedConsole.test.ts](#user-content-r0s251)|20 ✅|||171ms|
|[packages/jest-console/src/__tests__/CustomConsole.test.ts](#user-content-r0s252)|23 ✅|||115ms|
|[packages/jest-console/src/__tests__/getConsoleOutput.test.ts](#user-content-r0s253)|12 ✅|||56ms|
|[packages/jest-core/src/__tests__/FailedTestsCache.test.js](#user-content-r0s254)|1 ✅|||25ms|
|[packages/jest-core/src/__tests__/getNoTestsFoundMessage.test.js](#user-content-r0s255)|5 ✅|||61ms|
|[packages/jest-core/src/__tests__/globals.test.ts](#user-content-r0s256)|1 ✅|||22ms|
|[packages/jest-core/src/__tests__/runJest.test.js](#user-content-r0s257)|2 ✅|||261ms|
|[packages/jest-core/src/__tests__/SearchSource.test.ts](#user-content-r0s258)|27 ✅|||3s|
|[packages/jest-core/src/__tests__/SnapshotInteractiveMode.test.js](#user-content-r0s259)|13 ✅|||89ms|
|[packages/jest-core/src/__tests__/TestScheduler.test.js](#user-content-r0s260)|8 ✅|||520ms|
|[packages/jest-core/src/__tests__/testSchedulerHelper.test.js](#user-content-r0s261)|12 ✅|||48ms|
|[packages/jest-core/src/__tests__/watch.test.js](#user-content-r0s262)|80 ✅|||7s|
|[packages/jest-core/src/__tests__/watchFileChanges.test.ts](#user-content-r0s263)|1 ✅|||2s|
|[packages/jest-core/src/__tests__/watchFilenamePatternMode.test.js](#user-content-r0s264)|2 ✅|||165ms|
|[packages/jest-core/src/__tests__/watchTestNamePatternMode.test.js](#user-content-r0s265)|1 ✅|||246ms|
|[packages/jest-core/src/lib/__tests__/isValidPath.test.ts](#user-content-r0s266)|3 ✅|||166ms|
|[packages/jest-core/src/lib/__tests__/logDebugMessages.test.ts](#user-content-r0s267)|3 ✅|||48ms|
|[packages/jest-create-cache-key-function/src/__tests__/index.test.ts](#user-content-r0s268)|1 ✅|||75ms|
|[packages/jest-diff/src/__tests__/diff.test.ts](#user-content-r0s269)|107 ✅|||625ms|
|[packages/jest-diff/src/__tests__/diffStringsRaw.test.ts](#user-content-r0s270)|2 ✅|||55ms|
|[packages/jest-diff/src/__tests__/getAlignedDiffs.test.ts](#user-content-r0s271)|24 ✅|||72ms|
|[packages/jest-diff/src/__tests__/joinAlignedDiffs.test.ts](#user-content-r0s272)|6 ✅|||44ms|
|[packages/jest-docblock/src/__tests__/index.test.ts](#user-content-r0s273)|36 ✅|||177ms|
|[packages/jest-each/src/__tests__/array.test.ts](#user-content-r0s274)|159 ✅|||192ms|
|[packages/jest-each/src/__tests__/index.test.ts](#user-content-r0s275)|10 ✅|||44ms|
|[packages/jest-each/src/__tests__/template.test.ts](#user-content-r0s276)|242 ✅|||483ms|
|[packages/jest-environment-jsdom/src/__tests__/jsdom_environment.test.ts](#user-content-r0s277)|2 ✅|||783ms|
|[packages/jest-environment-node/src/__tests__/node_environment.test.ts](#user-content-r0s278)|6 ✅|||184ms|
|[packages/jest-fake-timers/src/__tests__/legacyFakeTimers.test.ts](#user-content-r0s279)|50 ✅|||302ms|
|[packages/jest-fake-timers/src/__tests__/modernFakeTimers.test.ts](#user-content-r0s280)|40 ✅|||317ms|
|[packages/jest-get-type/src/__tests__/getType.test.ts](#user-content-r0s281)|14 ✅|||45ms|
|[packages/jest-get-type/src/__tests__/isPrimitive.test.ts](#user-content-r0s282)|18 ✅|||36ms|
|[packages/jest-globals/src/__tests__/index.ts](#user-content-r0s283)|1 ✅|||533ms|
|[packages/jest-haste-map/src/__tests__/get_mock_name.test.js](#user-content-r0s284)|1 ✅|||22ms|
|[packages/jest-haste-map/src/__tests__/includes_dotfiles.test.ts](#user-content-r0s285)|1 ✅|||337ms|
|[packages/jest-haste-map/src/__tests__/index.test.js](#user-content-r0s286)|44 ✅|||1s|
|[packages/jest-haste-map/src/__tests__/worker.test.js](#user-content-r0s287)|7 ✅|||100ms|
|[packages/jest-haste-map/src/crawlers/__tests__/node.test.js](#user-content-r0s288)|10 ✅|||170ms|
|[packages/jest-haste-map/src/crawlers/__tests__/watchman.test.js](#user-content-r0s289)|8 ✅|||153ms|
|[packages/jest-haste-map/src/lib/__tests__/dependencyExtractor.test.js](#user-content-r0s290)|15 ✅|||56ms|
|[packages/jest-haste-map/src/lib/__tests__/fast_path.test.js](#user-content-r0s291)|5 ✅|||29ms|
|[packages/jest-haste-map/src/lib/__tests__/getPlatformExtension.test.js](#user-content-r0s292)|1 ✅|||35ms|
|[packages/jest-haste-map/src/lib/__tests__/isRegExpSupported.test.js](#user-content-r0s293)|2 ✅|||31ms|
|[packages/jest-haste-map/src/lib/__tests__/normalizePathSep.test.js](#user-content-r0s294)|2 ✅|||35ms|
|[packages/jest-jasmine2/src/__tests__/concurrent.test.ts](#user-content-r0s295)|3 ✅|||24ms|
|[packages/jest-jasmine2/src/__tests__/expectationResultFactory.test.ts](#user-content-r0s296)|7 ✅|||70ms|
|[packages/jest-jasmine2/src/__tests__/hooksError.test.ts](#user-content-r0s297)|32 ✅|||51ms|
|[packages/jest-jasmine2/src/__tests__/iterators.test.ts](#user-content-r0s298)|4 ✅|||43ms|
|[packages/jest-jasmine2/src/__tests__/itTestError.test.ts](#user-content-r0s299)|6 ✅|||32ms|
|[packages/jest-jasmine2/src/__tests__/itToTestAlias.test.ts](#user-content-r0s300)|1 ✅|||23ms|
|[packages/jest-jasmine2/src/__tests__/pTimeout.test.ts](#user-content-r0s301)|3 ✅|||44ms|
|[packages/jest-jasmine2/src/__tests__/queueRunner.test.ts](#user-content-r0s302)|6 ✅|||93ms|
|[packages/jest-jasmine2/src/__tests__/reporter.test.ts](#user-content-r0s303)|1 ✅|||107ms|
|[packages/jest-jasmine2/src/__tests__/Suite.test.ts](#user-content-r0s304)|1 ✅|||84ms|
|[packages/jest-jasmine2/src/__tests__/todoError.test.ts](#user-content-r0s305)|3 ✅|||27ms|
|[packages/jest-leak-detector/src/__tests__/index.test.ts](#user-content-r0s306)|6 ✅|||986ms|
|[packages/jest-matcher-utils/src/__tests__/deepCyclicCopyReplaceable.test.ts](#user-content-r0s307)|11 ✅|||49ms|
|[packages/jest-matcher-utils/src/__tests__/deepCyclicCopyReplaceableDom.test.ts](#user-content-r0s308)|2 ✅|||48ms|
|[packages/jest-matcher-utils/src/__tests__/index.test.ts](#user-content-r0s309)|48 ✅|||391ms|
|[packages/jest-matcher-utils/src/__tests__/printDiffOrStringify.test.ts](#user-content-r0s310)|21 ✅|||114ms|
|[packages/jest-matcher-utils/src/__tests__/Replaceable.test.ts](#user-content-r0s311)|17 ✅|||111ms|
|[packages/jest-message-util/src/__tests__/messages.test.ts](#user-content-r0s312)|11 ✅|||205ms|
|[packages/jest-mock/src/__tests__/index.test.ts](#user-content-r0s313)|84 ✅|||509ms|
|[packages/jest-regex-util/src/__tests__/index.test.ts](#user-content-r0s314)|8 ✅|||56ms|
|[packages/jest-repl/src/__tests__/jest_repl.test.js](#user-content-r0s315)|1 ✅|||1s|
|[packages/jest-repl/src/__tests__/runtime_cli.test.js](#user-content-r0s316)|4 ✅|||4s|
|[packages/jest-reporters/src/__tests__/CoverageReporter.test.js](#user-content-r0s317)|12 ✅|||397ms|
|[packages/jest-reporters/src/__tests__/CoverageWorker.test.js](#user-content-r0s318)|2 ✅|||199ms|
|[packages/jest-reporters/src/__tests__/DefaultReporter.test.js](#user-content-r0s319)|2 ✅|||148ms|
|[packages/jest-reporters/src/__tests__/generateEmptyCoverage.test.js](#user-content-r0s320)|3 ✅|||1s|
|[packages/jest-reporters/src/__tests__/getResultHeader.test.js](#user-content-r0s321)|4 ✅|||30ms|
|[packages/jest-reporters/src/__tests__/getSnapshotStatus.test.js](#user-content-r0s322)|3 ✅|||28ms|
|[packages/jest-reporters/src/__tests__/getSnapshotSummary.test.js](#user-content-r0s323)|4 ✅|||49ms|
|[packages/jest-reporters/src/__tests__/getWatermarks.test.ts](#user-content-r0s324)|2 ✅|||37ms|
|[packages/jest-reporters/src/__tests__/NotifyReporter.test.ts](#user-content-r0s325)|18 ✅|||166ms|
|[packages/jest-reporters/src/__tests__/SummaryReporter.test.js](#user-content-r0s326)|4 ✅|||366ms|
|[packages/jest-reporters/src/__tests__/utils.test.ts](#user-content-r0s327)|10 ✅|||85ms|
|[packages/jest-reporters/src/__tests__/VerboseReporter.test.js](#user-content-r0s328)|11 ✅|||425ms|
|[packages/jest-resolve-dependencies/src/__tests__/dependency_resolver.test.ts](#user-content-r0s329)|11 ✅|||666ms|
|[packages/jest-resolve/src/__tests__/isBuiltinModule.test.ts](#user-content-r0s330)|4 ✅|||36ms|
|[packages/jest-resolve/src/__tests__/resolve.test.ts](#user-content-r0s331)|16 ✅|||1s|
|[packages/jest-runner/src/__tests__/testRunner.test.ts](#user-content-r0s332)|2 ✅|||905ms|
|[packages/jest-runtime/src/__tests__/instrumentation.test.ts](#user-content-r0s333)|1 ✅|||275ms|
|[packages/jest-runtime/src/__tests__/runtime_create_mock_from_module.test.js](#user-content-r0s334)|3 ✅|||606ms|
|[packages/jest-runtime/src/__tests__/runtime_environment.test.js](#user-content-r0s335)|2 ✅|||497ms|
|[packages/jest-runtime/src/__tests__/runtime_internal_module.test.js](#user-content-r0s336)|4 ✅|||727ms|
|[packages/jest-runtime/src/__tests__/runtime_jest_fn.js](#user-content-r0s337)|4 ✅|||479ms|
|[packages/jest-runtime/src/__tests__/runtime_jest_spy_on.test.js](#user-content-r0s338)|2 ✅|||521ms|
|[packages/jest-runtime/src/__tests__/runtime_mock.test.js](#user-content-r0s339)|4 ✅|||743ms|
|[packages/jest-runtime/src/__tests__/runtime_module_directories.test.js](#user-content-r0s340)|4 ✅|||525ms|
|[packages/jest-runtime/src/__tests__/runtime_node_path.test.js](#user-content-r0s341)|4 ✅|||1s|
|[packages/jest-runtime/src/__tests__/runtime_require_actual.test.js](#user-content-r0s342)|2 ✅|||478ms|
|[packages/jest-runtime/src/__tests__/runtime_require_cache.test.js](#user-content-r0s343)|2 ✅|||454ms|
|[packages/jest-runtime/src/__tests__/runtime_require_mock.test.js](#user-content-r0s344)|13 ✅|||962ms|
|[packages/jest-runtime/src/__tests__/runtime_require_module_no_ext.test.js](#user-content-r0s345)|1 ✅|||261ms|
|[packages/jest-runtime/src/__tests__/runtime_require_module_or_mock_transitive_deps.test.js](#user-content-r0s346)|6 ✅|||2s|
|[packages/jest-runtime/src/__tests__/runtime_require_module_or_mock.test.js](#user-content-r0s347)|17 ✅|||1s|
|[packages/jest-runtime/src/__tests__/runtime_require_module.test.js](#user-content-r0s348)|27 ✅|||2s|
|[packages/jest-runtime/src/__tests__/runtime_require_resolve.test.ts](#user-content-r0s349)|5 ✅|||707ms|
|[packages/jest-runtime/src/__tests__/runtime_wrap.js](#user-content-r0s350)|2 ✅|||263ms|
|[packages/jest-runtime/src/__tests__/Runtime-sourceMaps.test.js](#user-content-r0s351)|1 ✅|||584ms|
|[packages/jest-runtime/src/__tests__/Runtime-statics.test.js](#user-content-r0s352)|2 ✅|||162ms|
|[packages/jest-serializer/src/__tests__/index.test.ts](#user-content-r0s353)|17 ✅|||158ms|
|[packages/jest-snapshot/src/__tests__/dedentLines.test.ts](#user-content-r0s354)|17 ✅|||94ms|
|[packages/jest-snapshot/src/__tests__/InlineSnapshots.test.ts](#user-content-r0s355)|22 ✅|||1s|
|[packages/jest-snapshot/src/__tests__/matcher.test.ts](#user-content-r0s356)|1 ✅|||131ms|
|[packages/jest-snapshot/src/__tests__/mockSerializer.test.ts](#user-content-r0s357)|10 ✅|||45ms|
|[packages/jest-snapshot/src/__tests__/printSnapshot.test.ts](#user-content-r0s358)|71 ✅|||1s|
|[packages/jest-snapshot/src/__tests__/SnapshotResolver.test.ts](#user-content-r0s359)|10 ✅|||98ms|
|[packages/jest-snapshot/src/__tests__/throwMatcher.test.ts](#user-content-r0s360)|3 ✅|||481ms|
|[packages/jest-snapshot/src/__tests__/utils.test.ts](#user-content-r0s361)|26 ✅|||214ms|
|[packages/jest-source-map/src/__tests__/getCallsite.test.ts](#user-content-r0s362)|3 ✅|||86ms|
|[packages/jest-test-result/src/__tests__/formatTestResults.test.ts](#user-content-r0s363)|1 ✅|||53ms|
|[packages/jest-test-sequencer/src/__tests__/test_sequencer.test.js](#user-content-r0s364)|8 ✅|||251ms|
|[packages/jest-transform/src/__tests__/ScriptTransformer.test.ts](#user-content-r0s365)|22 ✅|||2s|
|[packages/jest-transform/src/__tests__/shouldInstrument.test.ts](#user-content-r0s366)|25 ✅|||155ms|
|[packages/jest-util/src/__tests__/createProcessObject.test.ts](#user-content-r0s367)|4 ✅|||81ms|
|[packages/jest-util/src/__tests__/deepCyclicCopy.test.ts](#user-content-r0s368)|12 ✅|||86ms|
|[packages/jest-util/src/__tests__/errorWithStack.test.ts](#user-content-r0s369)|1 ✅|||41ms|
|[packages/jest-util/src/__tests__/formatTime.test.ts](#user-content-r0s370)|11 ✅|||82ms|
|[packages/jest-util/src/__tests__/globsToMatcher.test.ts](#user-content-r0s371)|4 ✅|||56ms|
|[packages/jest-util/src/__tests__/installCommonGlobals.test.ts](#user-content-r0s372)|2 ✅|||68ms|
|[packages/jest-util/src/__tests__/isInteractive.test.ts](#user-content-r0s373)|2 ✅|||35ms|
|[packages/jest-util/src/__tests__/isPromise.test.ts](#user-content-r0s374)|10 ✅|||30ms|
|[packages/jest-validate/src/__tests__/validate.test.ts](#user-content-r0s375)|23 ✅|||283ms|
|[packages/jest-validate/src/__tests__/validateCLIOptions.test.js](#user-content-r0s376)|6 ✅|||83ms|
|[packages/jest-watcher/src/lib/__tests__/formatTestNameByPattern.test.ts](#user-content-r0s377)|11 ✅|||129ms|
|[packages/jest-watcher/src/lib/__tests__/prompt.test.ts](#user-content-r0s378)|3 ✅|||91ms|
|[packages/jest-watcher/src/lib/__tests__/scroll.test.ts](#user-content-r0s379)|5 ✅|||57ms|
|[packages/jest-worker/src/__tests__/Farm.test.js](#user-content-r0s380)|10 ✅|||158ms|
|[packages/jest-worker/src/__tests__/FifoQueue.test.js](#user-content-r0s381)|3 ✅|||48ms|
|[packages/jest-worker/src/__tests__/index.test.js](#user-content-r0s382)|8 ✅|||230ms|
|[packages/jest-worker/src/__tests__/PriorityQueue.test.js](#user-content-r0s383)|5 ✅|||63ms|
|[packages/jest-worker/src/__tests__/process-integration.test.js](#user-content-r0s384)|5 ✅|||62ms|
|[packages/jest-worker/src/__tests__/thread-integration.test.js](#user-content-r0s385)|6 ✅|||114ms|
|[packages/jest-worker/src/__tests__/WorkerPool.test.js](#user-content-r0s386)|3 ✅|||51ms|
|[packages/jest-worker/src/base/__tests__/BaseWorkerPool.test.js](#user-content-r0s387)|11 ✅|||653ms|
|[packages/jest-worker/src/workers/__tests__/ChildProcessWorker.test.js](#user-content-r0s388)|17 ✅|||184ms|
|[packages/jest-worker/src/workers/__tests__/NodeThreadsWorker.test.js](#user-content-r0s389)|15 ✅|||258ms|
|[packages/jest-worker/src/workers/__tests__/processChild.test.js](#user-content-r0s390)|10 ✅|||135ms|
|[packages/jest-worker/src/workers/__tests__/threadChild.test.js](#user-content-r0s391)|10 ✅|||120ms|
|[packages/pretty-format/src/__tests__/AsymmetricMatcher.test.ts](#user-content-r0s392)|38 ✅|||137ms|
|[packages/pretty-format/src/__tests__/ConvertAnsi.test.ts](#user-content-r0s393)|6 ✅|||43ms|
|[packages/pretty-format/src/__tests__/DOMCollection.test.ts](#user-content-r0s394)|10 ✅|||64ms|
|[packages/pretty-format/src/__tests__/DOMElement.test.ts](#user-content-r0s395)|28 ✅|||148ms|
|[packages/pretty-format/src/__tests__/Immutable.test.ts](#user-content-r0s396)|111 ✅|||443ms|
|[packages/pretty-format/src/__tests__/prettyFormat.test.ts](#user-content-r0s397)|86 ✅|||219ms|
|[packages/pretty-format/src/__tests__/react.test.tsx](#user-content-r0s398)|55 ✅|||325ms|
|[packages/pretty-format/src/__tests__/ReactElement.test.ts](#user-content-r0s399)|3 ✅|||64ms|
### ✅ e2e/__tests__/asyncAndCallback.test.ts
```
✅ errors when a test both returns a promise and takes a callback
```
### ✅ e2e/__tests__/asyncRegenerator.test.ts
```
✅ successfully transpiles async
```
### ✅ e2e/__tests__/autoClearMocks.test.ts
```
✅ suite with auto-clear
✅ suite without auto-clear
```
### ✅ e2e/__tests__/autoResetMocks.test.ts
```
✅ suite with auto-reset
✅ suite without auto-reset
```
### ✅ e2e/__tests__/autoRestoreMocks.test.ts
```
✅ suite with auto-restore
✅ suite without auto-restore
```
### ✅ e2e/__tests__/babelPluginJestHoist.test.ts
```
✅ successfully runs the tests inside `babel-plugin-jest-hoist/`
```
### ✅ e2e/__tests__/badSourceMap.test.ts
```
✅ suite with test cases that contain malformed sourcemaps
```
### ✅ e2e/__tests__/beforeAllFiltered.ts
```
Correct BeforeAll run
✅ ensures the BeforeAll of ignored suite is not run
```
### ✅ e2e/__tests__/beforeEachQueue.ts
```
✅ does not work on jest-circus
Correct beforeEach order
⚪ ensures the correct order for beforeEach
```
### ✅ e2e/__tests__/callDoneTwice.test.ts
```
✅ `done()` should not be called more than once
```
### ✅ e2e/__tests__/chaiAssertionLibrary.ts
```
✅ chai assertion errors should display properly
```
### ✅ e2e/__tests__/circularInequality.test.ts
```
✅ handles circular inequality properly
```
### ✅ e2e/__tests__/circusConcurrentEach.test.ts
```
✅ works with concurrent.each
✅ works with concurrent.only.each
```
### ✅ e2e/__tests__/circusDeclarationErrors.test.ts
```
✅ defining tests and hooks asynchronously throws
```
### ✅ e2e/__tests__/clearCache.test.ts
```
jest --clearCache
✅ normal run results in cache directory being written
✅ clearCache results in deleted directory and exitCode 0
```
### ✅ e2e/__tests__/cliHandlesExactFilenames.test.ts
```
✅ CLI accepts exact file names if matchers matched
✅ CLI skips exact file names if no matchers matched
```
### ✅ e2e/__tests__/compareDomNodes.test.ts
```
✅ does not crash when expect involving a DOM node fails
```
### ✅ e2e/__tests__/config.test.ts
```
✅ config as JSON
✅ works with sane config JSON
✅ watchman config option is respected over default argv
✅ config from argv is respected with sane config JSON
✅ works with jsdom testEnvironmentOptions config JSON
✅ negated flags override previous flags
```
### ✅ e2e/__tests__/console.test.ts
```
✅ console printing
✅ console printing with --verbose
✅ does not print to console with --silent
✅ respects --noStackTrace
✅ respects noStackTrace in config
✅ the jsdom console is the same as the test console
✅ does not error out when using winston
```
### ✅ e2e/__tests__/consoleAfterTeardown.test.ts
```
✅ console printing
```
### ✅ e2e/__tests__/consoleLogOutputWhenRunInBand.test.ts
```
✅ prints console.logs when run with forceExit
```
### ✅ e2e/__tests__/coverageHandlebars.test.ts
```
✅ code coverage for Handlebars
```
### ✅ e2e/__tests__/coverageRemapping.test.ts
```
✅ maps code coverage against original source
```
### ✅ e2e/__tests__/coverageReport.test.ts
```
✅ outputs coverage report
✅ collects coverage only from specified file
✅ collects coverage only from multiple specified files
✅ collects coverage only from specified files avoiding dependencies
✅ json reporter printing with --coverage
✅ outputs coverage report as json
✅ outputs coverage report when text is requested
✅ outputs coverage report when text-summary is requested
✅ outputs coverage report when text and text-summary is requested
✅ does not output coverage report when html is requested
✅ collects coverage from duplicate files avoiding shared cache
✅ generates coverage when using the testRegex config param
```
### ✅ e2e/__tests__/coverageThreshold.test.ts
```
✅ exits with 1 if coverage threshold is not met
✅ exits with 1 if path threshold group is not found in coverage data
✅ exits with 0 if global threshold group is not found in coverage data
✅ excludes tests matched by path threshold groups from global group
✅ file is matched by all path and glob threshold groups
```
### ✅ e2e/__tests__/coverageTransformInstrumented.test.ts
```
✅ code coverage for transform instrumented code
```
### ✅ e2e/__tests__/coverageWithoutTransform.test.ts
```
✅ produces code coverage for uncovered files without transformer
```
### ✅ e2e/__tests__/createProcessObject.test.ts
```
✅ allows retrieving the current domain
```
### ✅ e2e/__tests__/customInlineSnapshotMatchers.test.ts
```
✅ works with custom inline snapshot matchers
```
### ✅ e2e/__tests__/customMatcherStackTrace.test.ts
```
✅ works with custom matchers
✅ custom async matchers
```
### ✅ e2e/__tests__/customReporters.test.ts
```
Custom Reporters Integration
✅ valid string format for adding reporters
✅ valid array format for adding reporters
✅ invalid format for adding reporters
✅ default reporters enabled
✅ TestReporter with all tests passing
✅ TestReporter with all tests failing
✅ IncompleteReporter for flexibility
✅ reporters can be default exports
✅ prints reporter errors
```
### ✅ e2e/__tests__/customResolver.test.ts
```
✅ use the custom resolver
```
### ✅ e2e/__tests__/customTestSequencers.test.ts
```
✅ run prioritySequence first sync
✅ run prioritySequence first async
✅ run failed tests async
```
### ✅ e2e/__tests__/debug.test.ts
```
jest --debug
✅ outputs debugging info before running the test
```
### ✅ e2e/__tests__/declarationErrors.test.ts
```
✅ errors if describe returns a Promise
✅ errors if describe returns something
✅ errors if describe throws
```
### ✅ e2e/__tests__/dependencyClash.test.ts
```
✅ does not require project modules from inside node_modules
```
### ✅ e2e/__tests__/detectOpenHandles.ts
```
✅ prints message about flag on slow tests
✅ prints message about flag on forceExit
✅ prints out info about open handlers
✅ does not report promises
✅ prints out info about open handlers from inside tests
on node >=11.10.0
✅ does not report ELD histograms
notify
✅ does not report --notify flag
on node >=11
✅ does not report timeouts using unref
```
### ✅ e2e/__tests__/domDiffing.test.ts
```
✅ should work without error
```
### ✅ e2e/__tests__/doneInHooks.test.ts
```
✅ `done()` works properly in hooks
```
### ✅ e2e/__tests__/dynamicRequireDependencies.ts
```
✅ successfully runs tests with dynamic dependencies
```
### ✅ e2e/__tests__/each.test.ts
```
✅ works with passing tests
✅ shows error message when not enough arguments are supplied to tests
✅ shows the correct errors in stderr when failing tests
✅ shows only the tests with .only as being ran
✅ shows only the tests without .skip as being ran
✅ runs only the describe.only.each tests
✅ formats args with pretty format when given %p
```
### ✅ e2e/__tests__/emptyDescribeWithHooks.test.ts
```
✅ hook in empty describe
✅ hook in describe with skipped test
✅ hook in empty nested describe
✅ multiple hooks in empty describe
```
### ✅ e2e/__tests__/emptySuiteError.test.ts
```
JSON Reporter
✅ fails the test suite if it contains no tests
```
### ✅ e2e/__tests__/env.test.ts
```
Environment override
✅ uses jsdom when specified
✅ uses node as default from package.json
✅ uses node when specified
✅ fails when the env is not available
Environment equivalent
✅ uses jsdom
✅ uses node
```
### ✅ e2e/__tests__/environmentAfterTeardown.test.ts
```
✅ prints useful error for environment methods after test is done
```
### ✅ e2e/__tests__/errorOnDeprecated.test.ts
```
✅ does not work on jest-circus
⚪ fail.test.js errors in errorOnDeprecated mode
⚪ jasmine.addMatchers.test.js errors in errorOnDeprecated mode
⚪ jasmine.any.test.js errors in errorOnDeprecated mode
⚪ jasmine.anything.test.js errors in errorOnDeprecated mode
⚪ jasmine.arrayContaining.test.js errors in errorOnDeprecated mode
⚪ jasmine.createSpy.test.js errors in errorOnDeprecated mode
⚪ jasmine.objectContaining.test.js errors in errorOnDeprecated mode
⚪ jasmine.stringMatching.test.js errors in errorOnDeprecated mode
⚪ pending.test.js errors in errorOnDeprecated mode
⚪ spyOn.test.js errors in errorOnDeprecated mode
⚪ spyOnProperty.test.js errors in errorOnDeprecated mode
⚪ defaultTimeoutInterval.test.js errors in errorOnDeprecated mode
⚪ fail.test.js errors when not in errorOnDeprecated mode
⚪ jasmine.addMatchers.test.js passes when not in errorOnDeprecated mode
⚪ jasmine.any.test.js passes when not in errorOnDeprecated mode
⚪ jasmine.anything.test.js passes when not in errorOnDeprecated mode
⚪ jasmine.arrayContaining.test.js passes when not in errorOnDeprecated mode
⚪ jasmine.createSpy.test.js passes when not in errorOnDeprecated mode
⚪ jasmine.objectContaining.test.js passes when not in errorOnDeprecated mode
⚪ jasmine.stringMatching.test.js passes when not in errorOnDeprecated mode
⚪ pending.test.js passes when not in errorOnDeprecated mode
⚪ spyOn.test.js passes when not in errorOnDeprecated mode
⚪ spyOnProperty.test.js errors when not in errorOnDeprecated mode
⚪ defaultTimeoutInterval.test.js passes when not in errorOnDeprecated mode
```
### ✅ e2e/__tests__/esmConfigFile.test.ts
```
✅ reads config from cjs file
on node ^12.17.0 || >=13.2.0
✅ reads config from mjs file
✅ reads config from js file when package.json#type=module
```
### ✅ e2e/__tests__/executeTestsOnceInMpr.ts
```
✅ Tests are executed only once even in an MPR
```
### ✅ e2e/__tests__/existentRoots.test.ts
```
✅ error when rootDir does not exist
✅ error when rootDir is a file
✅ error when roots directory does not exist
✅ error when roots is a file
```
### ✅ e2e/__tests__/expectAsyncMatcher.test.ts
```
✅ works with passing tests
✅ shows the correct errors in stderr when failing tests
```
### ✅ e2e/__tests__/expectInVm.test.ts
```
✅ expect works correctly with RegExps created inside a VM
```
### ✅ e2e/__tests__/extraGlobals.test.ts
```
✅ works with injected globals
```
### ✅ e2e/__tests__/failureDetailsProperty.test.ts
```
✅ that the failureDetails property is set
```
### ✅ e2e/__tests__/failures.test.ts
```
✅ not throwing Error objects
✅ works with node assert
✅ works with assertions in separate files
✅ works with async failures
✅ works with snapshot failures
✅ works with snapshot failures with hint
✅ errors after test has completed
```
### ✅ e2e/__tests__/fakePromises.test.ts
```
Fake promises
✅ should be possible to resolve with fake timers using immediates
✅ should be possible to resolve with fake timers using asap
```
### ✅ e2e/__tests__/fatalWorkerError.test.ts
```
✅ fails a test that terminates the worker with a fatal error
```
### ✅ e2e/__tests__/filter.test.ts
```
Dynamic test filtering
✅ uses the default JSON option
✅ uses the CLI option
✅ ignores the filter if requested to do so
✅ throws when you return clowny stuff
✅ will call setup on filter before filtering
✅ will print error when filter throws
✅ will return no results when setup hook throws
```
### ✅ e2e/__tests__/findRelatedFiles.test.ts
```
--findRelatedTests flag
✅ runs tests related to filename
✅ runs tests related to uppercased filename on case-insensitive os
✅ runs tests related to filename with a custom dependency extractor
✅ generates coverage report for filename
✅ coverage configuration is applied correctly
```
### ✅ e2e/__tests__/focusedTests.test.ts
```
✅ runs only "it.only" tests
```
### ✅ e2e/__tests__/forceExit.test.ts
```
✅ exits the process after test are done but before timers complete
```
### ✅ e2e/__tests__/generatorMock.test.ts
```
✅ mock works with generator
```
### ✅ e2e/__tests__/global-mutation.test.ts
```
✅ can redefine global
```
### ✅ e2e/__tests__/global.test.ts
```
✅ globals are properly defined
```
### ✅ e2e/__tests__/globals.test.ts
```
✅ basic test constructs
✅ interleaved describe and test children order
✅ skips
✅ only
✅ cannot have describe with no implementation
✅ cannot test with no implementation
✅ skips with expand arg
✅ only with expand arg
✅ cannot test with no implementation with expand arg
✅ function as descriptor
```
### ✅ e2e/__tests__/globalSetup.test.ts
```
✅ globalSetup is triggered once before all test suites
✅ jest throws an error when globalSetup does not export a function
✅ globalSetup function gets jest config object as a parameter
✅ should call globalSetup function of multiple projects
✅ should not call a globalSetup of a project if there are no tests to run from this project
✅ should not call any globalSetup if there are no tests to run
✅ globalSetup works with default export
✅ globalSetup throws with named export
✅ should not transpile the transformer
✅ should transform node_modules if configured by transformIgnorePatterns
```
### ✅ e2e/__tests__/globalTeardown.test.ts
```
✅ globalTeardown is triggered once after all test suites
✅ jest throws an error when globalTeardown does not export a function
✅ globalTeardown function gets jest config object as a parameter
✅ should call globalTeardown function of multiple projects
✅ should not call a globalTeardown of a project if there are no tests to run from this project
✅ globalTeardown works with default export
✅ globalTeardown throws with named export
```
### ✅ e2e/__tests__/hasteMapMockChanged.test.ts
```
✅ should not warn when a mock file changes
```
### ✅ e2e/__tests__/hasteMapSha1.test.ts
```
✅ exits the process after test are done but before timers complete
```
### ✅ e2e/__tests__/hasteMapSize.test.ts
```
✅ reports the correct file size
✅ updates the file size when a file changes
```
### ✅ e2e/__tests__/importedGlobals.test.ts
```
✅ imported globals
```
### ✅ e2e/__tests__/injectGlobals.test.ts
```
✅ globals are undefined if passed `false` from CLI
✅ globals are undefined if passed `false` from config
```
### ✅ e2e/__tests__/jasmineAsync.test.ts
```
async jasmine
✅ works with beforeAll
✅ works with beforeEach
✅ works with afterAll
✅ works with afterEach
✅ works with fit
✅ works with xit
✅ throws when not a promise is returned
✅ tests async promise code
✅ works with concurrent
✅ works with concurrent within a describe block when invoked with testNamePattern
✅ works with concurrent.each
✅ works with concurrent.only.each
✅ doesn't execute more than 5 tests simultaneously
✅ async test fails
✅ generator test
```
### ✅ e2e/__tests__/jasmineAsyncWithPendingDuringTest.ts
```
async jasmine with pending during test
✅ does not work on jest-circus
⚪ should be reported as a pending test
```
### ✅ e2e/__tests__/jest.config.js.test.ts
```
✅ works with jest.config.js
✅ traverses directory tree up until it finds jest.config
✅ invalid JS in jest.config.js
```
### ✅ e2e/__tests__/jest.config.ts.test.ts
```
✅ works with jest.config.ts
✅ works with tsconfig.json
✅ traverses directory tree up until it finds jest.config
✅ it does type check the config
✅ invalid JS in jest.config.ts
```
### ❌ e2e/__tests__/jestChangedFiles.test.ts
```
✅ gets hg SCM roots and dedupes them
✅ gets git SCM roots and dedupes them
✅ gets mixed git and hg SCM roots and dedupes them
✅ gets changed files for git
✅ monitors only root paths for git
✅ does not find changes in files with no diff, for git
✅ handles a bad revision for "changedSince", for git
❌ gets changed files for hg
Error: abort: empty revision range
✅ monitors only root paths for hg
✅ handles a bad revision for "changedSince", for hg
```
### ✅ e2e/__tests__/jestEnvironmentJsdom.test.ts
```
✅ check is not leaking memory
```
### ✅ e2e/__tests__/jestRequireActual.test.ts
```
✅ understands dependencies using jest.requireActual
```
### ✅ e2e/__tests__/jestRequireMock.test.ts
```
✅ understands dependencies using jest.requireMock
```
### ✅ e2e/__tests__/json.test.ts
```
✅ JSON is available in the global scope
✅ JSON.parse creates objects from within this context
```
### ✅ e2e/__tests__/jsonReporter.test.ts
```
JSON Reporter
✅ writes test result to sum.result.json
✅ outputs coverage report
```
### ✅ e2e/__tests__/lifecycles.ts
```
✅ suite with invalid assertions in afterAll
```
### ✅ e2e/__tests__/listTests.test.ts
```
--listTests flag
✅ causes tests to be printed in different lines
✅ causes tests to be printed out as JSON when using the --json flag
```
### ✅ e2e/__tests__/locationInResults.test.ts
```
✅ defaults to null for location
✅ adds correct location info when provided with flag
```
### ✅ e2e/__tests__/logHeapUsage.test.ts
```
✅ logs memory usage
```
### ✅ e2e/__tests__/mockNames.test.ts
```
✅ suite without mock name, mock called
✅ suite without mock name, mock not called
✅ suite with mock name, expect mock not called
✅ suite with mock name, mock called, expect fail
✅ suite with mock name, mock called 5 times
✅ suite with mock name, mock not called 5 times, expect fail
✅ suite with mock name, mock called
✅ suite with mock name, mock not called
```
### ✅ e2e/__tests__/modernFakeTimers.test.ts
```
modern implementation of fake timers
✅ should be possible to use modern implementation from config
✅ should be possible to use modern implementation from jest-object
```
### ✅ e2e/__tests__/moduleNameMapper.test.ts
```
✅ moduleNameMapper wrong configuration
✅ moduleNameMapper wrong array configuration
✅ moduleNameMapper correct configuration
✅ moduleNameMapper correct configuration mocking module of absolute path
✅ moduleNameMapper with mocking
```
### ✅ e2e/__tests__/moduleParentNullInTest.ts
```
✅ module.parent should be null in test files
```
### ✅ e2e/__tests__/multiProjectRunner.test.ts
```
✅ --listTests doesn't duplicate the test files
✅ can pass projects or global config
✅ "No tests found" message for projects
✅ allows a single non-root project
✅ allows a single non-root project
✅ correctly runs a single non-root project
✅ correctly runs a single non-root project
✅ projects can be workspaces with non-JS/JSON files
✅ objects in project configuration
✅ allows a single project
✅ resolves projects and their properly
✅ Does transform files with the corresponding project transformer
doesn't bleed module file extensions resolution with multiple workers
✅ external config files
✅ inline config files
```
### ✅ e2e/__tests__/nativeAsyncMock.test.ts
```
✅ mocks async functions
```
### ✅ e2e/__tests__/nativeEsm.test.ts
```
✅ test config is without transform
on node ^12.16.0 || >=13.7.0
✅ runs test with native ESM
on node >=14.3.0
⚪ supports top-level await
```
### ✅ e2e/__tests__/nativeEsmTypescript.test.ts
```
on node ^12.16.0 || >=13.7.0
✅ runs TS test with native ESM
```
### ✅ e2e/__tests__/nestedEventLoop.test.ts
```
✅ works with nested event loops
```
### ✅ e2e/__tests__/nestedTestDefinitions.test.ts
```
✅ print correct error message with nested test definitions outside describe
✅ print correct error message with nested test definitions inside describe
✅ print correct message when nesting describe inside it
✅ print correct message when nesting a hook inside it
```
### ✅ e2e/__tests__/nodePath.test.ts
```
✅ supports NODE_PATH
```
### ✅ e2e/__tests__/noTestFound.test.ts
```
Coverage Report
✅ outputs coverage report
File path not found in mulit-project scenario
✅ outputs coverage report
```
### ✅ e2e/__tests__/noTestsFound.test.ts
```
No tests are found
✅ fails the test suite in standard situation
✅ doesn't fail the test suite if --passWithNoTests passed
✅ doesn't fail the test suite if using --lastCommit
✅ doesn't fail the test suite if using --onlyChanged
✅ doesn't fail the test suite if using --findRelatedTests
```
### ❌ e2e/__tests__/onlyChanged.test.ts
```
✅ run for "onlyChanged" and "changedSince"
✅ run only changed files
✅ report test coverage for only changed files
✅ report test coverage of source on test file change under only changed files
✅ do not pickup non-tested files when reporting coverage on only changed files
✅ collect test coverage when using onlyChanged
✅ onlyChanged in config is overwritten by --all or testPathPattern
❌ gets changed files for hg
Error: expect(received).toMatch(expected)
✅ path on Windows is case-insensitive
```
### ✅ e2e/__tests__/onlyFailuresNonWatch.test.ts
```
✅ onlyFailures flag works in non-watch mode
```
### ✅ e2e/__tests__/overrideGlobals.test.ts
```
✅ overriding native promise does not freeze Jest
✅ has a duration even if time is faked
```
### ✅ e2e/__tests__/pnp.test.ts
```
✅ successfully runs the tests inside `pnp/`
```
### ✅ e2e/__tests__/presets.test.ts
```
✅ supports json preset
✅ supports js preset
```
### ✅ e2e/__tests__/processExit.test.ts
```
✅ prints stack trace pointing to process.exit call
```
### ✅ e2e/__tests__/promiseReject.test.ts
```
✅
```
### ✅ e2e/__tests__/regexCharInPath.test.ts
```
Regex Char In Path
✅ parses paths containing regex chars correctly
```
### ✅ e2e/__tests__/requireAfterTeardown.test.ts
```
✅ prints useful error for requires after test is done
```
### ✅ e2e/__tests__/requireMain.test.ts
```
✅ provides `require.main` set to test suite module
```
### ✅ e2e/__tests__/requireMainAfterCreateRequire.test.ts
```
on node >=12.2.0
✅ `require.main` not undefined after createRequire
```
### ✅ e2e/__tests__/requireMainIsolateModules.test.ts
```
✅ `require.main` on using `jest.isolateModules` should not be undefined
```
### ✅ e2e/__tests__/requireMainResetModules.test.ts
```
✅ `require.main` on using `--resetModules='true'` should not be undefined
✅ `require.main` on using `jest.resetModules()` should not be undefined
```
### ✅ e2e/__tests__/requireV8Module.test.ts
```
✅ v8 module
```
### ✅ e2e/__tests__/resetModules.test.ts
```
✅ jest.resetModules should not error when _isMockFunction is defined but not boolean
```
### ✅ e2e/__tests__/resolve.test.ts
```
✅ resolve platform modules
```
### ✅ e2e/__tests__/resolveGetPaths.test.ts
```
✅ require.resolve.paths
```
### ✅ e2e/__tests__/resolveNodeModule.test.ts
```
✅ resolve node module
```
### ✅ e2e/__tests__/resolveNoFileExtensions.test.ts
```
✅ show error message with matching files
✅ show error message when no js moduleFileExtensions
```
### ✅ e2e/__tests__/resolveWithPaths.test.ts
```
✅ require.resolve with paths
```
### ✅ e2e/__tests__/runProgrammatically.test.ts
```
✅ run Jest programmatically cjs
✅ run Jest programmatically esm
```
### ✅ e2e/__tests__/runTestsByPath.test.ts
```
✅ runs tests by exact path
```
### ✅ e2e/__tests__/runtimeInternalModuleRegistry.test.ts
```
Runtime Internal Module Registry
✅ correctly makes use of internal module registry when requiring modules
```
### ✅ e2e/__tests__/selectProjects.test.ts
```
Given a config with two named projects, first-project and second-project when Jest is started with `--selectProjects first-project`
✅ runs the tests in the first project only
✅ prints that only first-project will run
Given a config with two named projects, first-project and second-project when Jest is started with `--selectProjects second-project`
✅ runs the tests in the second project only
✅ prints that only second-project will run
Given a config with two named projects, first-project and second-project when Jest is started with `--selectProjects first-project second-project`
✅ runs the tests in the first and second projects
✅ prints that both first-project and second-project will run
Given a config with two named projects, first-project and second-project when Jest is started without providing `--selectProjects`
✅ runs the tests in the first and second projects
✅ does not print which projects are run
Given a config with two named projects, first-project and second-project when Jest is started with `--selectProjects third-project`
✅ fails
✅ prints that no project was found
Given a config with two projects, first-project and an unnamed project when Jest is started with `--selectProjects first-project`
✅ runs the tests in the first project only
✅ prints that a project does not have a name
✅ prints that only first-project will run
Given a config with two projects, first-project and an unnamed project when Jest is started without providing `--selectProjects`
✅ runs the tests in the first and second projects
✅ does not print that a project has no name
Given a config with two projects, first-project and an unnamed project when Jest is started with `--selectProjects third-project`
✅ fails
✅ prints that a project does not have a name
✅ prints that no project was found
```
### ✅ e2e/__tests__/setImmediate.test.ts
```
✅ setImmediate
```
### ✅ e2e/__tests__/setupFilesAfterEnvConfig.test.ts
```
setupFilesAfterEnv
✅ requires multiple setup files before each file in the suite
✅ requires setup files *after* the test runners are required
```
### ✅ e2e/__tests__/showConfig.test.ts
```
✅ --showConfig outputs config info and exits
```
### ✅ e2e/__tests__/skipBeforeAfterAll.test.ts
```
✅ correctly skip `beforeAll`s in skipped tests
```
### ✅ e2e/__tests__/snapshot-unknown.test.ts
```
Snapshot serializers
✅ renders snapshot
```
### ✅ e2e/__tests__/snapshot.test.ts
```
Snapshot
✅ stores new snapshots on the first run
✅ works with escaped characters
✅ works with escaped regex
✅ works with template literal substitutions
Snapshot Validation
✅ does not save snapshots in CI mode by default
✅ works on subsequent runs without `-u`
✅ deletes the snapshot if the test suite has been removed
✅ deletes a snapshot when a test does removes all the snapshots
✅ updates the snapshot when a test removes some snapshots
```
### ✅ e2e/__tests__/snapshotMockFs.test.ts
```
✅ store snapshot even if fs is mocked
```
### ✅ e2e/__tests__/snapshotResolver.test.ts
```
Custom snapshot resolver
✅ Resolves snapshot files using custom resolver
```
### ✅ e2e/__tests__/snapshotSerializers.test.ts
```
Snapshot serializers
✅ renders snapshot
✅ compares snapshots correctly
```
### ✅ e2e/__tests__/stackTrace.test.ts
```
Stack Trace
✅ prints a stack trace for runtime errors
✅ does not print a stack trace for runtime errors when --noStackTrace is given
✅ prints a stack trace for matching errors
✅ does not print a stack trace for matching errors when --noStackTrace is given
✅ prints a stack trace for errors
✅ prints a stack trace for errors without message in stack trace
✅ does not print a stack trace for errors when --noStackTrace is given
```
### ✅ e2e/__tests__/stackTraceNoCaptureStackTrace.test.ts
```
✅ prints a usable stack trace even if no Error.captureStackTrace
```
### ✅ e2e/__tests__/stackTraceSourceMaps.test.ts
```
✅ processes stack traces and code frames with source maps
```
### ✅ e2e/__tests__/stackTraceSourceMapsWithCoverage.test.ts
```
✅ processes stack traces and code frames with source maps with coverage
```
### ✅ e2e/__tests__/supportsDashedArgs.ts
```
✅ works with passing tests
✅ throws error for unknown dashed & camelcase args
```
### ✅ e2e/__tests__/symbol.test.ts
```
✅ Symbol deletion
```
### ✅ e2e/__tests__/testEnvironment.test.ts
```
✅ respects testEnvironment docblock
```
### ✅ e2e/__tests__/testEnvironmentAsync.test.ts
```
✅ triggers setup/teardown hooks
```
### ✅ e2e/__tests__/testEnvironmentCircus.test.ts
```
✅ calls testEnvironment handleTestEvent
```
### ✅ e2e/__tests__/testEnvironmentCircusAsync.test.ts
```
✅ calls asynchronous handleTestEvent in testEnvironment
```
### ✅ e2e/__tests__/testFailureExitCode.test.ts
```
✅ exits with a specified code when test fail
✅ exits with a specified code when bailing from a failed test
```
### ✅ e2e/__tests__/testInRoot.test.ts
```
✅ runs tests in only test.js and spec.js
```
### ✅ e2e/__tests__/testNamePattern.test.ts
```
✅ testNamePattern
```
### ✅ e2e/__tests__/testNamePatternSkipped.test.ts
```
✅ testNamePattern skipped
```
### ✅ e2e/__tests__/testPathPatternReporterMessage.test.ts
```
✅ prints a message with path pattern at the end
```
### ✅ e2e/__tests__/testResultsProcessor.test.ts
```
✅ testNamePattern
```
### ✅ e2e/__tests__/testRetries.test.ts
```
Test Retries
✅ retries failed tests
✅ reporter shows more than 1 invocation if test is retried
✅ reporter shows 1 invocation if tests are not retried
✅ tests are not retried if beforeAll hook failure occurs
```
### ✅ e2e/__tests__/testTodo.test.ts
```
✅ works with all statuses
✅ shows error messages when called with no arguments
✅ shows error messages when called with multiple arguments
✅ shows error messages when called with invalid argument
✅ shows todo messages when in verbose mode
```
### ✅ e2e/__tests__/timeouts.test.ts
```
✅ exceeds the timeout
✅ does not exceed the timeout
✅ exceeds the command line testTimeout
✅ does not exceed the command line testTimeout
```
### ✅ e2e/__tests__/timeoutsLegacy.test.ts
```
✅ does not work on jest-circus
⚪ exceeds the timeout set using jasmine.DEFAULT_TIMEOUT_INTERVAL
⚪ does not exceed the timeout using jasmine.DEFAULT_TIMEOUT_INTERVAL
⚪ can read and write jasmine.DEFAULT_TIMEOUT_INTERVAL
```
### ✅ e2e/__tests__/timerResetMocks.test.ts
```
✅ run timers after resetAllMocks test
✅ run timers with resetMocks in config test
```
### ✅ e2e/__tests__/timerUseRealTimers.test.ts
```
✅ useRealTimers cancels "timers": "fake" for whole test file
```
### ✅ e2e/__tests__/toMatchInlineSnapshot.test.ts
```
✅ basic support
✅ do not indent empty lines
✅ handles property matchers
✅ removes obsolete external snapshots
✅ supports async matchers
✅ supports async tests
✅ writes snapshots with non-literals in expect(...)
✅ handles mocking native modules prettier relies on
✅ supports custom matchers
✅ supports custom matchers with property matcher
✅ multiple custom matchers and native matchers
✅ indentation is correct in the presences of existing snapshots
```
### ✅ e2e/__tests__/toMatchInlineSnapshotWithRetries.test.ts
```
✅ works with a single snapshot
✅ works when a different assertion is failing
✅ works when multiple tests have snapshots but only one of them failed multiple times
```
### ✅ e2e/__tests__/toMatchSnapshot.test.ts
```
✅ basic support
✅ error thrown before snapshot
✅ first snapshot fails, second passes
✅ does not mark snapshots as obsolete in skipped tests
✅ accepts custom snapshot name
✅ handles property matchers
✅ handles invalid property matchers
✅ handles property matchers with hint
✅ handles property matchers with deep properties
```
### ✅ e2e/__tests__/toMatchSnapshotWithRetries.test.ts
```
✅ works with a single snapshot
✅ works when multiple tests have snapshots but only one of them failed multiple times
```
### ✅ e2e/__tests__/toMatchSnapshotWithStringSerializer.test.ts
```
✅ empty external
✅ empty internal ci false
✅ undefined internal ci true
```
### ✅ e2e/__tests__/toThrowErrorMatchingInlineSnapshot.test.ts
```
✅ works fine when function throws error
✅ updates existing snapshot
✅ cannot be used with .not
✅ should support rejecting promises
```
### ✅ e2e/__tests__/toThrowErrorMatchingSnapshot.test.ts
```
✅ works fine when function throws error
✅ throws the error if tested function didn't throw error
✅ accepts custom snapshot name
✅ cannot be used with .not
✅ should support rejecting promises
```
### ✅ e2e/__tests__/transform.test.ts
```
babel-jest
✅ runs transpiled code
✅ instruments only specific files and collects coverage
babel-jest ignored
✅ tells user to match ignored files
babel-jest with manual transformer
✅ runs transpiled code
no babel-jest
✅ fails with syntax error on flow types
✅ instrumentation with no babel-jest
custom transformer
✅ proprocesses files
✅ instruments files
multiple-transformers
✅ transforms dependencies using specific transformers
ecmascript-modules-support
✅ runs transpiled code
transformer-config
✅ runs transpiled code
✅ instruments only specific files and collects coverage
transformer caching
✅ does not rerun transform within worker
transform-environment
✅ should transform the environment
transform-runner
✅ should transform runner
transform-testrunner
✅ should transform testRunner
```
### ✅ e2e/__tests__/transformLinkedModules.test.ts
```
✅ should transform linked modules
```
### ✅ e2e/__tests__/typescriptCoverage.test.ts
```
✅ instruments and collects coverage for typescript files
```
### ✅ e2e/__tests__/unexpectedToken.test.ts
```
✅ triggers unexpected token error message for non-JS assets
✅ triggers unexpected token error message for untranspiled node_modules
✅ does not trigger unexpected token error message for regular syntax errors
```
### ✅ e2e/__tests__/useStderr.test.ts
```
✅ no tests found message is redirected to stderr
```
### ✅ e2e/__tests__/v8Coverage.test.ts
```
✅ prints coverage with missing sourcemaps
✅ prints coverage with empty sourcemaps
```
### ✅ e2e/__tests__/verbose.test.ts
```
✅ Verbose Reporter
```
### ✅ e2e/__tests__/version.test.ts
```
✅ works with jest.config.js
```
### ✅ e2e/__tests__/watchModeNoAccess.test.ts
```
✅ does not re-run tests when only access time is modified
```
### ✅ e2e/__tests__/watchModeOnlyFailed.test.ts
```
✅ can press "f" to run only failed tests
```
### ✅ e2e/__tests__/watchModePatterns.test.ts
```
✅ can press "p" to filter by file name
✅ can press "t" to filter by test name
```
### ✅ e2e/__tests__/watchModeUpdateSnapshot.test.ts
```
✅ can press "u" to update snapshots
```
### ✅ e2e/__tests__/workerForceExit.test.ts
```
✅ prints a warning if a worker is force exited
✅ force exits a worker that fails to exit gracefully
```
### ✅ e2e/__tests__/wrongEnv.test.ts
```
Wrong globals for environment
✅ print useful error for window
✅ print useful error for document
✅ print useful error for navigator
✅ print useful error for unref
✅ print useful error when it explodes during evaluation
```
### ✅ e2e/custom-test-sequencer/a.test.js
```
✅ a
```
### ✅ e2e/custom-test-sequencer/b.test.js
```
✅ b
```
### ✅ e2e/custom-test-sequencer/c.test.js
```
✅ c
```
### ✅ e2e/custom-test-sequencer/d.test.js
```
✅ d
```
### ✅ e2e/custom-test-sequencer/e.test.js
```
✅ e
```
### ✅ e2e/test-in-root/spec.js
```
✅ stub
```
### ✅ e2e/test-in-root/test.js
```
✅ stub
```
### ✅ e2e/timer-reset-mocks/after-reset-all-mocks/timerAndMock.test.js
```
timers
✅ should work before calling resetAllMocks
✅ should not break after calling resetAllMocks
```
### ✅ e2e/timer-reset-mocks/with-reset-mocks/timerWithMock.test.js
```
timers
✅ should work before calling resetAllMocks
```
### ✅ e2e/v8-coverage/empty-sourcemap/test.ts
```
✅ dummy-test
```
### ✅ examples/angular/app.component.spec.ts
```
AppComponent
✅ should create the app
✅ should have as title 'angular'
✅ should render title in a h1 tag
```
### ✅ examples/angular/shared/data.service.spec.ts
```
Service: DataService
✅ should create service
✅ should return the right title
```
### ✅ examples/angular/shared/sub.service.spec.ts
```
Service: SubService
✅ should create service
```
### ✅ examples/async/__tests__/user.test.js
```
✅ works with resolves
✅ works with promises
✅ works with async/await
✅ works with async/await and resolves
✅ tests error with rejects
✅ tests error with promises
✅ tests error with async/await
✅ tests error with async/await and rejects
```
### ✅ examples/automatic-mocks/__tests__/automock.test.js
```
✅ if utils are mocked
✅ mocked implementation
```
### ✅ examples/automatic-mocks/__tests__/createMockFromModule.test.js
```
✅ implementation created by automock
✅ implementation created by jest.createMockFromModule
```
### ✅ examples/automatic-mocks/__tests__/disableAutomocking.test.js
```
✅ original implementation
```
### ✅ examples/enzyme/__tests__/CheckboxWithLabel-test.js
```
✅ CheckboxWithLabel changes the text after click
```
### ✅ examples/getting-started/sum.test.js
```
✅ adds 1 + 2 to equal 3
```
### ✅ examples/jquery/__tests__/display_user.test.js
```
✅ displays a user after a click
```
### ✅ examples/jquery/__tests__/fetch_current_user.test.js
```
✅ calls into $.ajax with the correct params
✅ calls the callback when $.ajax requests are finished
```
### ✅ examples/manual-mocks/__tests__/file_summarizer.test.js
```
listFilesInDirectorySync
✅ includes all files in the directory in the summary
```
### ✅ examples/manual-mocks/__tests__/lodashMocking.test.js
```
✅ if lodash head is mocked
```
### ✅ examples/manual-mocks/__tests__/user.test.js
```
✅ if orginal user model
```
### ✅ examples/manual-mocks/__tests__/userMocked.test.js
```
✅ if user model is mocked
```
### ✅ examples/module-mock/__tests__/full_mock.js
```
✅ does a full mock
```
### ✅ examples/module-mock/__tests__/mock_per_test.js
```
define mock per test
✅ uses mocked module
✅ uses actual module
```
### ✅ examples/module-mock/__tests__/partial_mock.js
```
✅ does a partial mock
```
### ✅ examples/mongodb/__test__/db.test.js
```
✅ should aggregate docs from collection
```
### ✅ examples/react-native/__tests__/intro.test.js
```
✅ renders correctly
✅ renders the ActivityIndicator component
✅ renders the TextInput component
✅ renders the FlatList component
```
### ✅ examples/react-testing-library/__tests__/CheckboxWithLabel-test.js
```
✅ CheckboxWithLabel changes the text after click
```
### ✅ examples/react/__tests__/CheckboxWithLabel-test.js
```
✅ CheckboxWithLabel changes the text after click
```
### ✅ examples/snapshot/__tests__/clock.react.test.js
```
✅ renders correctly
```
### ✅ examples/snapshot/__tests__/link.react.test.js
```
✅ renders correctly
✅ renders as an anchor when no page is set
✅ properly escapes quotes
✅ changes the class when hovered
```
### ✅ examples/timer/__tests__/infinite_timer_game.test.js
```
✅ schedules a 10-second timer after 1 second
```
### ✅ examples/timer/__tests__/timer_game.test.js
```
timerGame
✅ waits 1 second before ending the game
✅ calls the callback after 1 second via runAllTimers
✅ calls the callback after 1 second via advanceTimersByTime
```
### ✅ examples/typescript/__tests__/calc.test.ts
```
calc - mocks
✅ returns result from subtract
✅ returns result from sum
✅ adds last result to memory
✅ subtracts last result to memory
✅ clears the memory
✅ throws an error when invalid Op is passed
```
### ✅ examples/typescript/__tests__/CheckboxWithLabel-test.tsx
```
✅ CheckboxWithLabel changes the text after click
```
### ✅ examples/typescript/__tests__/sub-test.ts
```
✅ subtracts 5 - 1 to equal 4 in TypeScript
```
### ✅ examples/typescript/__tests__/sum-test.ts
```
✅ adds 1 + 2 to equal 3 in TScript
✅ adds 1 + 2 to equal 3 in JavaScript
```
### ✅ examples/typescript/__tests__/sum.test.js
```
✅ adds 1 + 2 to equal 3 in Typescript
✅ adds 1 + 2 to equal 3 in JavaScript
```
### ✅ packages/babel-jest/src/__tests__/index.ts
```
✅ Returns source string with inline maps when no transformOptions is passed
✅ can pass null to createTransformer
caller option correctly merges from defaults and options
✅ {"supportsDynamicImport":true,"supportsStaticESM":true} -> {"supportsDynamicImport":true,"supportsStaticESM":true}
✅ {"supportsDynamicImport":false,"supportsStaticESM":false} -> {"supportsDynamicImport":false,"supportsStaticESM":false}
✅ {"supportsStaticESM":false} -> {"supportsDynamicImport":false,"supportsStaticESM":false}
✅ {"supportsDynamicImport":true} -> {"supportsDynamicImport":true,"supportsStaticESM":false}
```
### ✅ packages/babel-plugin-jest-hoist/src/__tests__/hoistPlugin.test.ts
```
babel-plugin-jest-hoist
✅ automatic react runtime
✅ top level mocking
✅ within a block
✅ within a block with no siblings
```
### ✅ packages/diff-sequences/src/__tests__/index.property.test.ts
```
✅ should be reflexive
✅ should find the same number of common items when switching the inputs
✅ should have at most the length of its inputs
✅ should have at most the same number of each character as its inputs
✅ should be a subsequence of its inputs
✅ should be no-op when passing common items
✅ should find the exact common items when one array is subarray of the other
```
### ✅ packages/diff-sequences/src/__tests__/index.test.ts
```
invalid arg length
✅ is not a number
✅ Infinity is not a safe integer
✅ Not a Number is not a safe integer
✅ MAX_SAFE_INTEGER + 1 is not a safe integer
✅ MIN_SAFE_INTEGER - 1 is not a safe integer
✅ is a negative integer
invalid arg callback
✅ null is not a function
✅ undefined is not a function
input callback encapsulates comparison zero and negative zero
✅ are not common according to Object.is method
✅ are common according to === operator
input callback encapsulates comparison Not a Number
✅ is common according to Object.is method
✅ is not common according to === operator
input callback encapsulates sequences
✅ arrays of strings
✅ string and array of strings
✅ strings
no common items negative zero is equivalent to zero for length
✅ of a
✅ of b
✅ of a and b
no common items
✅ a empty and b empty
✅ a empty and b non-empty
✅ a non-empty and b empty
no common items a non-empty and b non-empty
✅ baDeltaLength 0 even
✅ baDeltaLength 1 odd
✅ baDeltaLength 2 even
✅ baDeltaLength 7 odd
only common items
✅ length 1
✅ length 2
all common items outside
✅ preceding changes
✅ following change
✅ preceding and following changes in one sequence
some common items inside and outside
✅ preceding changes adjacent to common in both sequences
✅ following changes adjacent to common in both sequences
all common items inside non-recursive
✅ move from start to end relative to change
✅ move from start to end relative to common
✅ move from start to end relative to change and common
✅ reverse relative to change
✅ preceding middle
✅ following middle
all common items inside recursive
✅ prev reverse at depth 1 and preceding at depth 2
✅ last forward at depth 1 and following at depth 2
✅ preceding at depth 2 and both at depth 3 of following
✅ interleaved single change
✅ interleaved double changes
✅ optimization decreases iMaxF
✅ optimization decreases iMaxR
common substrings
✅ progress
✅ regression
✅ wrapping
```
### ✅ packages/expect/src/__tests__/assertionCounts.test.ts
```
.assertions()
✅ does not throw
✅ redeclares different assertion count
✅ expects no assertions
.hasAssertions()
✅ does not throw if there is an assertion
✅ throws if expected is not undefined
✅ hasAssertions not leaking to global state
```
### ✅ packages/expect/src/__tests__/asymmetricMatchers.test.ts
```
✅ Any.asymmetricMatch()
✅ Any.toAsymmetricMatcher()
✅ Any.toAsymmetricMatcher() with function name
✅ Any throws when called with empty constructor
✅ Anything matches any type
✅ Anything does not match null and undefined
✅ Anything.toAsymmetricMatcher()
✅ ArrayContaining matches
✅ ArrayContaining does not match
✅ ArrayContaining throws for non-arrays
✅ ArrayNotContaining matches
✅ ArrayNotContaining does not match
✅ ArrayNotContaining throws for non-arrays
✅ ObjectContaining matches
✅ ObjectContaining does not match
✅ ObjectContaining matches defined properties
✅ ObjectContaining matches prototype properties
✅ ObjectContaining throws for non-objects
✅ ObjectContaining does not mutate the sample
✅ ObjectNotContaining matches
✅ ObjectNotContaining does not match
✅ ObjectNotContaining inverts ObjectContaining
✅ ObjectNotContaining throws for non-objects
✅ StringContaining matches string against string
✅ StringContaining throws if expected value is not string
✅ StringContaining returns false if received value is not string
✅ StringNotContaining matches string against string
✅ StringNotContaining throws if expected value is not string
✅ StringNotContaining returns true if received value is not string
✅ StringMatching matches string against regexp
✅ StringMatching matches string against string
✅ StringMatching throws if expected value is neither string nor regexp
✅ StringMatching returns false if received value is not string
✅ StringMatching returns false even if coerced non-string received value matches pattern
✅ StringNotMatching matches string against regexp
✅ StringNotMatching matches string against string
✅ StringNotMatching throws if expected value is neither string nor regexp
✅ StringNotMatching returns true if received value is not string
```
### ✅ packages/expect/src/__tests__/extend.test.ts
```
✅ is available globally when matcher is unary
✅ is available globally when matcher is variadic
✅ exposes matcherUtils in context
✅ is ok if there is no message specified
✅ exposes an equality function to custom matchers
✅ defines asymmetric unary matchers
✅ defines asymmetric unary matchers that can be prefixed by not
✅ defines asymmetric variadic matchers
✅ defines asymmetric variadic matchers that can be prefixed by not
✅ prints the Symbol into the error message
```
### ✅ packages/expect/src/__tests__/isError.test.ts
```
isError
✅ should not assume objects are errors
✅ should detect simple error instances
✅ should detect errors from another context
✅ should detect DOMException errors from another context
```
### ✅ packages/expect/src/__tests__/matchers-toContain.property.test.ts
```
toContain
✅ should always find the value when inside the array
✅ should not find the value if it has been cloned into the array
```
### ✅ packages/expect/src/__tests__/matchers-toContainEqual.property.test.ts
```
toContainEqual
✅ should always find the value when inside the array
✅ should always find the value when cloned inside the array
```
### ✅ packages/expect/src/__tests__/matchers-toEqual.property.test.ts
```
toEqual
✅ should be reflexive
✅ should be symmetric
```
### ✅ packages/expect/src/__tests__/matchers-toStrictEqual.property.test.ts
```
toStrictEqual
✅ should be reflexive
✅ should be symmetric
toStrictEqual on node >=9
✅ should be equivalent to Node deepStrictEqual
```
### ✅ packages/expect/src/__tests__/matchers.test.js
```
✅ should throw if passed two arguments
.rejects
✅ should reject
✅ should reject with toThrow
✅ should reject async function to toThrow
✅ fails non-promise value "a" synchronously
✅ fails non-promise value "a"
✅ fails non-promise value [1] synchronously
✅ fails non-promise value [1]
✅ fails non-promise value [Function anonymous] synchronously
✅ fails non-promise value [Function anonymous]
✅ fails non-promise value {"a": 1} synchronously
✅ fails non-promise value {"a": 1}
✅ fails non-promise value 4 synchronously
✅ fails non-promise value 4
✅ fails non-promise value null synchronously
✅ fails non-promise value null
✅ fails non-promise value true synchronously
✅ fails non-promise value true
✅ fails non-promise value undefined synchronously
✅ fails non-promise value undefined
✅ fails for promise that resolves
.resolves
✅ should resolve
✅ fails non-promise value "a" synchronously
✅ fails non-promise value "a"
✅ fails non-promise value [1] synchronously
✅ fails non-promise value [1]
✅ fails non-promise value [Function anonymous] synchronously
✅ fails non-promise value [Function anonymous]
✅ fails non-promise value {"a": 1} synchronously
✅ fails non-promise value {"a": 1}
✅ fails non-promise value 4 synchronously
✅ fails non-promise value 4
✅ fails non-promise value null synchronously
✅ fails non-promise value null
✅ fails non-promise value true synchronously
✅ fails non-promise value true
✅ fails non-promise value undefined synchronously
✅ fails non-promise value undefined
✅ fails for promise that rejects
.toBe()
✅ does not throw
✅ fails for: 1 and 2
✅ fails for: true and false
✅ fails for: [Function anonymous] and [Function anonymous]
✅ fails for: {} and {}
✅ fails for: {"a": 1} and {"a": 1}
✅ fails for: {"a": 1} and {"a": 5}
✅ fails for: {"a": [Function a], "b": 2} and {"a": Any, "b": 2}
✅ fails for: {"a": undefined, "b": 2} and {"b": 2}
✅ fails for: 2020-02-20T00:00:00.000Z and 2020-02-20T00:00:00.000Z
✅ fails for: 2020-02-21T00:00:00.000Z and 2020-02-20T00:00:00.000Z
✅ fails for: /received/ and /expected/
✅ fails for: Symbol(received) and Symbol(expected)
✅ fails for: [Error: received] and [Error: expected]
✅ fails for: "abc" and "cde"
✅ fails for: "painless JavaScript testing" and "delightful JavaScript testing"
✅ fails for: "" and "compare one-line string to empty string"
✅ fails for: "with
trailing space" and "without trailing space"
✅ fails for: "four
4
line
string" and "3
line
string"
✅ fails for: [] and []
✅ fails for: null and undefined
✅ fails for: -0 and 0
✅ fails for: 1n and 2n
✅ fails for: {"a": 1n} and {"a": 1n}
✅ fails for 'false' with '.not'
✅ fails for '1' with '.not'
✅ fails for '"a"' with '.not'
✅ fails for 'undefined' with '.not'
✅ fails for 'null' with '.not'
✅ fails for '{}' with '.not'
✅ fails for '[]' with '.not'
✅ fails for '1n' with '.not'
✅ fails for '1n' with '.not'
✅ does not crash on circular references
✅ assertion error matcherResult property contains matcher name, expected and actual values
.toStrictEqual()
✅ does not ignore keys with undefined values
✅ does not ignore keys with undefined values inside an array
✅ does not ignore keys with undefined values deep inside an object
✅ passes when comparing same type
✅ matches the expected snapshot when it fails
✅ displays substring diff
✅ displays substring diff for multiple lines
✅ does not pass for different types
✅ does not simply compare constructor names
✅ passes for matching sparse arrays
✅ does not pass when sparseness of arrays do not match
✅ does not pass when equally sparse arrays have different values
.toEqual()
✅ {pass: false} expect(true).toEqual(false)
✅ {pass: false} expect(1).toEqual(2)
✅ {pass: false} expect(0).toEqual(-0)
✅ {pass: false} expect(0).toEqual(5e-324)
✅ {pass: false} expect(5e-324).toEqual(0)
✅ {pass: false} expect(0).toEqual({})
✅ {pass: false} expect({}).toEqual(0)
✅ {pass: false} expect({}).toEqual({})
✅ {pass: false} expect("abc").toEqual({"0": "a", "1": "b", "2": "c"})
✅ {pass: false} expect({"0": "a", "1": "b", "2": "c"}).toEqual("abc")
✅ {pass: false} expect(/abc/gsy).toEqual(/abc/g)
✅ {pass: false} expect({"a": 1}).toEqual({"a": 2})
✅ {pass: false} expect({"a": 5}).toEqual({"b": 6})
✅ {pass: false} expect({"foo": {"bar": 1}}).toEqual({"foo": {}})
✅ {pass: false} expect({"getterAndSetter": {}}).toEqual({"getterAndSetter": {"foo": "bar"}})
✅ {pass: false} expect({"frozenGetterAndSetter": {}}).toEqual({"frozenGetterAndSetter": {"foo": "bar"}})
✅ {pass: false} expect({"getter": {}}).toEqual({"getter": {"foo": "bar"}})
✅ {pass: false} expect({"frozenGetter": {}}).toEqual({"frozenGetter": {"foo": "bar"}})
✅ {pass: false} expect({"setter": undefined}).toEqual({"setter": {"foo": "bar"}})
✅ {pass: false} expect({"frozenSetter": undefined}).toEqual({"frozenSetter": {"foo": "bar"}})
✅ {pass: false} expect("banana").toEqual("apple")
✅ {pass: false} expect("1 234,57 $").toEqual("1 234,57 $")
✅ {pass: false} expect("type TypeName = T extends Function ? \"function\" : \"object\";").toEqual("type TypeName = T extends Function
? \"function\"
: \"object\";")
✅ {pass: false} expect(null).toEqual(undefined)
✅ {pass: false} expect([1]).toEqual([2])
✅ {pass: false} expect([1, 2]).toEqual([2, 1])
✅ {pass: false} expect(Immutable.List [1]).toEqual(Immutable.List [2])
✅ {pass: false} expect(Immutable.List [1, 2]).toEqual(Immutable.List [2, 1])
✅ {pass: false} expect(Map {}).toEqual(Set {})
✅ {pass: false} expect(Set {1, 2}).toEqual(Set {})
✅ {pass: false} expect(Set {1, 2}).toEqual(Set {1, 2, 3})
✅ {pass: false} expect(Set {[1], [2]}).toEqual(Set {[1], [2], [3]})
✅ {pass: false} expect(Set {[1], [2]}).toEqual(Set {[1], [2], [2]})
✅ {pass: false} expect(Set {Set {1}, Set {2}}).toEqual(Set {Set {1}, Set {3}})
✅ {pass: false} expect(Immutable.Set [1, 2]).toEqual(Immutable.Set [])
✅ {pass: false} expect(Immutable.Set [1, 2]).toEqual(Immutable.Set [1, 2, 3])
✅ {pass: false} expect(Immutable.OrderedSet [1, 2]).toEqual(Immutable.OrderedSet [2, 1])
✅ {pass: false} expect(Map {1 => "one", 2 => "two"}).toEqual(Map {1 => "one"})
✅ {pass: false} expect(Map {"a" => 0}).toEqual(Map {"b" => 0})
✅ {pass: false} expect(Map {"v" => 1}).toEqual(Map {"v" => 2})
✅ {pass: false} expect(Map {["v"] => 1}).toEqual(Map {["v"] => 2})
✅ {pass: false} expect(Map {[1] => Map {[1] => "one"}}).toEqual(Map {[1] => Map {[1] => "two"}})
✅ {pass: false} expect(Immutable.Map {"a": 0}).toEqual(Immutable.Map {"b": 0})
✅ {pass: false} expect(Immutable.Map {"v": 1}).toEqual(Immutable.Map {"v": 2})
✅ {pass: false} expect(Immutable.OrderedMap {1: "one", 2: "two"}).toEqual(Immutable.OrderedMap {2: "two", 1: "one"})
✅ {pass: false} expect(Immutable.Map {"1": Immutable.Map {"2": {"a": 99}}}).toEqual(Immutable.Map {"1": Immutable.Map {"2": {"a": 11}}})
✅ {pass: false} expect([97, 98, 99]).toEqual([97, 98, 100])
✅ {pass: false} expect({"a": 1, "b": 2}).toEqual(ObjectContaining {"a": 2})
✅ {pass: false} expect(false).toEqual(ObjectContaining {"a": 2})
✅ {pass: false} expect([1, 3]).toEqual(ArrayContaining [1, 2])
✅ {pass: false} expect(1).toEqual(ArrayContaining [1, 2])
✅ {pass: false} expect("abd").toEqual(StringContaining "bc")
✅ {pass: false} expect("abd").toEqual(StringMatching /bc/i)
✅ {pass: false} expect(undefined).toEqual(Anything)
✅ {pass: false} expect(undefined).toEqual(Any)
✅ {pass: false} expect("Eve").toEqual({"asymmetricMatch": [Function asymmetricMatch]})
✅ {pass: false} expect({"target": {"nodeType": 1, "value": "a"}}).toEqual({"target": {"nodeType": 1, "value": "b"}})
✅ {pass: false} expect({"nodeName": "div", "nodeType": 1}).toEqual({"nodeName": "p", "nodeType": 1})
✅ {pass: false} expect({Symbol(foo): 1, Symbol(bar): 2}).toEqual({Symbol(foo): Any, Symbol(bar): 1})
✅ {pass: false} expect(1n).toEqual(2n)
✅ {pass: false} expect(1n).toEqual(1)
✅ {pass: true} expect(true).not.toEqual(true)
✅ {pass: true} expect(1).not.toEqual(1)
✅ {pass: true} expect(NaN).not.toEqual(NaN)
✅ {pass: true} expect(0).not.toEqual(0)
✅ {pass: true} expect(0).not.toEqual(0)
✅ {pass: true} expect({}).not.toEqual({})
✅ {pass: true} expect("abc").not.toEqual("abc")
✅ {pass: true} expect("abc").not.toEqual("abc")
✅ {pass: true} expect("abc").not.toEqual("abc")
✅ {pass: true} expect([1]).not.toEqual([1])
✅ {pass: true} expect([1, 2]).not.toEqual([1, 2])
✅ {pass: true} expect(Immutable.List [1]).not.toEqual(Immutable.List [1])
✅ {pass: true} expect(Immutable.List [1, 2]).not.toEqual(Immutable.List [1, 2])
✅ {pass: true} expect({}).not.toEqual({})
✅ {pass: true} expect({"a": 99}).not.toEqual({"a": 99})
✅ {pass: true} expect(Set {}).not.toEqual(Set {})
✅ {pass: true} expect(Set {1, 2}).not.toEqual(Set {1, 2})
✅ {pass: true} expect(Set {1, 2}).not.toEqual(Set {2, 1})
✅ {pass: true} expect(Set {[1], [2]}).not.toEqual(Set {[2], [1]})
✅ {pass: true} expect(Set {Set {[1]}, Set {[2]}}).not.toEqual(Set {Set {[2]}, Set {[1]}})
✅ {pass: true} expect(Set {[1], [2], [3], [3]}).not.toEqual(Set {[3], [3], [2], [1]})
✅ {pass: true} expect(Set {{"a": 1}, {"b": 2}}).not.toEqual(Set {{"b": 2}, {"a": 1}})
✅ {pass: true} expect(Immutable.Set []).not.toEqual(Immutable.Set [])
✅ {pass: true} expect(Immutable.Set [1, 2]).not.toEqual(Immutable.Set [1, 2])
✅ {pass: true} expect(Immutable.Set [1, 2]).not.toEqual(Immutable.Set [2, 1])
✅ {pass: true} expect(Immutable.OrderedSet []).not.toEqual(Immutable.OrderedSet [])
✅ {pass: true} expect(Immutable.OrderedSet [1, 2]).not.toEqual(Immutable.OrderedSet [1, 2])
✅ {pass: true} expect(Map {}).not.toEqual(Map {})
✅ {pass: true} expect(Map {1 => "one", 2 => "two"}).not.toEqual(Map {1 => "one", 2 => "two"})
✅ {pass: true} expect(Map {1 => "one", 2 => "two"}).not.toEqual(Map {2 => "two", 1 => "one"})
✅ {pass: true} expect(Map {[1] => "one", [2] => "two", [3] => "three", [3] => "four"}).not.toEqual(Map {[3] => "three", [3] => "four", [2] => "two", [1] => "one"})
✅ {pass: true} expect(Map {[1] => Map {[1] => "one"}, [2] => Map {[2] => "two"}}).not.toEqual(Map {[2] => Map {[2] => "two"}, [1] => Map {[1] => "one"}})
✅ {pass: true} expect(Map {[1] => "one", [2] => "two"}).not.toEqual(Map {[2] => "two", [1] => "one"})
✅ {pass: true} expect(Map {{"a": 1} => "one", {"b": 2} => "two"}).not.toEqual(Map {{"b": 2} => "two", {"a": 1} => "one"})
✅ {pass: true} expect(Map {1 => ["one"], 2 => ["two"]}).not.toEqual(Map {2 => ["two"], 1 => ["one"]})
✅ {pass: true} expect(Immutable.Map {}).not.toEqual(Immutable.Map {})
✅ {pass: true} expect(Immutable.Map {1: "one", 2: "two"}).not.toEqual(Immutable.Map {1: "one", 2: "two"})
✅ {pass: true} expect(Immutable.Map {1: "one", 2: "two"}).not.toEqual(Immutable.Map {2: "two", 1: "one"})
✅ {pass: true} expect(Immutable.OrderedMap {1: "one", 2: "two"}).not.toEqual(Immutable.OrderedMap {1: "one", 2: "two"})
✅ {pass: true} expect(Immutable.Map {"1": Immutable.Map {"2": {"a": 99}}}).not.toEqual(Immutable.Map {"1": Immutable.Map {"2": {"a": 99}}})
✅ {pass: true} expect([97, 98, 99]).not.toEqual([97, 98, 99])
✅ {pass: true} expect({"a": 1, "b": 2}).not.toEqual(ObjectContaining {"a": 1})
✅ {pass: true} expect([1, 2, 3]).not.toEqual(ArrayContaining [2, 3])
✅ {pass: true} expect("abcd").not.toEqual(StringContaining "bc")
✅ {pass: true} expect("abcd").not.toEqual(StringMatching /bc/)
✅ {pass: true} expect(true).not.toEqual(Anything)
✅ {pass: true} expect([Function anonymous]).not.toEqual(Any)
✅ {pass: true} expect({"a": 1, "b": [Function b], "c": true}).not.toEqual({"a": 1, "b": Any, "c": Anything})
✅ {pass: true} expect("Alice").not.toEqual({"asymmetricMatch": [Function asymmetricMatch]})
✅ {pass: true} expect({"nodeName": "div", "nodeType": 1}).not.toEqual({"nodeName": "div", "nodeType": 1})
✅ {pass: true} expect({Symbol(foo): 1, Symbol(bar): 2}).not.toEqual({Symbol(foo): Any, Symbol(bar): 2})
✅ {pass: true} expect(1n).not.toEqual(1n)
✅ {pass: true} expect(0n).not.toEqual(0n)
✅ {pass: true} expect([1n]).not.toEqual([1n])
✅ {pass: true} expect([1n, 2]).not.toEqual([1n, 2])
✅ {pass: true} expect(Immutable.List [1n]).not.toEqual(Immutable.List [1n])
✅ {pass: true} expect({"a": 99n}).not.toEqual({"a": 99n})
✅ {pass: true} expect(Set {1n, 2n}).not.toEqual(Set {1n, 2n})
✅ assertion error matcherResult property contains matcher name, expected and actual values
✅ symbol based keys in arrays are processed correctly
✅ non-enumerable members should be skipped during equal
✅ non-enumerable symbolic members should be skipped during equal
.toEqual() cyclic object equality
✅ properties with the same circularity are equal
✅ properties with different circularity are not equal
✅ are not equal if circularity is not on the same property
.toBeInstanceOf()
✅ passing Map {} and [Function Map]
✅ passing [] and [Function Array]
✅ passing {} and [Function A]
✅ passing {} and [Function B]
✅ passing {} and [Function B]
✅ passing {} and [Function anonymous]
✅ passing {} and [Function B]
✅ passing {} and [Function name() {}]
✅ failing "a" and [Function String]
✅ failing 1 and [Function Number]
✅ failing true and [Function Boolean]
✅ failing {} and [Function B]
✅ failing {} and [Function A]
✅ failing undefined and [Function String]
✅ failing null and [Function String]
✅ failing /\w+/ and [Function anonymous]
✅ failing {} and [Function RegExp]
✅ throws if constructor is not a function
.toBeTruthy(), .toBeFalsy()
✅ does not accept arguments
✅ '{}' is truthy
✅ '[]' is truthy
✅ 'true' is truthy
✅ '1' is truthy
✅ '"a"' is truthy
✅ '0.5' is truthy
✅ 'Map {}' is truthy
✅ '[Function anonymous]' is truthy
✅ 'Infinity' is truthy
✅ '1n' is truthy
✅ 'false' is falsy
✅ 'null' is falsy
✅ 'NaN' is falsy
✅ '0' is falsy
✅ '""' is falsy
✅ 'undefined' is falsy
✅ '0n' is falsy
.toBeNaN()
✅ {pass: true} expect(NaN).toBeNaN()
✅ throws
.toBeNull()
✅ fails for '{}'
✅ fails for '[]'
✅ fails for 'true'
✅ fails for '1'
✅ fails for '"a"'
✅ fails for '0.5'
✅ fails for 'Map {}'
✅ fails for '[Function anonymous]'
✅ fails for 'Infinity'
✅ fails for null with .not
✅ pass for null
.toBeDefined(), .toBeUndefined()
✅ '{}' is defined
✅ '[]' is defined
✅ 'true' is defined
✅ '1' is defined
✅ '"a"' is defined
✅ '0.5' is defined
✅ 'Map {}' is defined
✅ '[Function anonymous]' is defined
✅ 'Infinity' is defined
✅ '1n' is defined
✅ undefined is undefined
.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual()
✅ {pass: true} expect(1).toBeLessThan(2)
✅ {pass: false} expect(2).toBeLessThan(1)
✅ {pass: true} expect(2).toBeGreaterThan(1)
✅ {pass: false} expect(1).toBeGreaterThan(2)
✅ {pass: true} expect(1).toBeLessThanOrEqual(2)
✅ {pass: false} expect(2).toBeLessThanOrEqual(1)
✅ {pass: true} expect(2).toBeGreaterThanOrEqual(1)
✅ {pass: false} expect(1).toBeGreaterThanOrEqual(2)
✅ throws: [1, 2]
✅ {pass: true} expect(-Infinity).toBeLessThan(Infinity)
✅ {pass: false} expect(Infinity).toBeLessThan(-Infinity)
✅ {pass: true} expect(Infinity).toBeGreaterThan(-Infinity)
✅ {pass: false} expect(-Infinity).toBeGreaterThan(Infinity)
✅ {pass: true} expect(-Infinity).toBeLessThanOrEqual(Infinity)
✅ {pass: false} expect(Infinity).toBeLessThanOrEqual(-Infinity)
✅ {pass: true} expect(Infinity).toBeGreaterThanOrEqual(-Infinity)
✅ {pass: false} expect(-Infinity).toBeGreaterThanOrEqual(Infinity)
✅ throws: [-Infinity, Infinity]
✅ {pass: true} expect(5e-324).toBeLessThan(1.7976931348623157e+308)
✅ {pass: false} expect(1.7976931348623157e+308).toBeLessThan(5e-324)
✅ {pass: true} expect(1.7976931348623157e+308).toBeGreaterThan(5e-324)
✅ {pass: false} expect(5e-324).toBeGreaterThan(1.7976931348623157e+308)
✅ {pass: true} expect(5e-324).toBeLessThanOrEqual(1.7976931348623157e+308)
✅ {pass: false} expect(1.7976931348623157e+308).toBeLessThanOrEqual(5e-324)
✅ {pass: true} expect(1.7976931348623157e+308).toBeGreaterThanOrEqual(5e-324)
✅ {pass: false} expect(5e-324).toBeGreaterThanOrEqual(1.7976931348623157e+308)
✅ throws: [5e-324, 1.7976931348623157e+308]
✅ {pass: true} expect(17).toBeLessThan(34)
✅ {pass: false} expect(34).toBeLessThan(17)
✅ {pass: true} expect(34).toBeGreaterThan(17)
✅ {pass: false} expect(17).toBeGreaterThan(34)
✅ {pass: true} expect(17).toBeLessThanOrEqual(34)
✅ {pass: false} expect(34).toBeLessThanOrEqual(17)
✅ {pass: true} expect(34).toBeGreaterThanOrEqual(17)
✅ {pass: false} expect(17).toBeGreaterThanOrEqual(34)
✅ throws: [17, 34]
✅ {pass: true} expect(3).toBeLessThan(7)
✅ {pass: false} expect(7).toBeLessThan(3)
✅ {pass: true} expect(7).toBeGreaterThan(3)
✅ {pass: false} expect(3).toBeGreaterThan(7)
✅ {pass: true} expect(3).toBeLessThanOrEqual(7)
✅ {pass: false} expect(7).toBeLessThanOrEqual(3)
✅ {pass: true} expect(7).toBeGreaterThanOrEqual(3)
✅ {pass: false} expect(3).toBeGreaterThanOrEqual(7)
✅ throws: [3, 7]
✅ {pass: true} expect(9).toBeLessThan(18)
✅ {pass: false} expect(18).toBeLessThan(9)
✅ {pass: true} expect(18).toBeGreaterThan(9)
✅ {pass: false} expect(9).toBeGreaterThan(18)
✅ {pass: true} expect(9).toBeLessThanOrEqual(18)
✅ {pass: false} expect(18).toBeLessThanOrEqual(9)
✅ {pass: true} expect(18).toBeGreaterThanOrEqual(9)
✅ {pass: false} expect(9).toBeGreaterThanOrEqual(18)
✅ throws: [9, 18]
✅ {pass: true} expect(0.1).toBeLessThan(0.2)
✅ {pass: false} expect(0.2).toBeLessThan(0.1)
✅ {pass: true} expect(0.2).toBeGreaterThan(0.1)
✅ {pass: false} expect(0.1).toBeGreaterThan(0.2)
✅ {pass: true} expect(0.1).toBeLessThanOrEqual(0.2)
✅ {pass: false} expect(0.2).toBeLessThanOrEqual(0.1)
✅ {pass: true} expect(0.2).toBeGreaterThanOrEqual(0.1)
✅ {pass: false} expect(0.1).toBeGreaterThanOrEqual(0.2)
✅ throws: [0.1, 0.2]
✅ can compare BigInt to Numbers
✅ {pass: true} expect(1n).toBeLessThan(2n)
✅ {pass: false} expect(2n).toBeLessThan(1n)
✅ {pass: true} expect(2n).toBeGreaterThan(1n)
✅ {pass: false} expect(1n).toBeGreaterThan(2n)
✅ {pass: true} expect(1n).toBeLessThanOrEqual(2n)
✅ {pass: false} expect(2n).toBeLessThanOrEqual(1n)
✅ {pass: true} expect(2n).toBeGreaterThanOrEqual(1n)
✅ {pass: false} expect(1n).toBeGreaterThanOrEqual(2n)
✅ throws: [1n, 2n]
✅ {pass: true} expect(17n).toBeLessThan(34n)
✅ {pass: false} expect(34n).toBeLessThan(17n)
✅ {pass: true} expect(34n).toBeGreaterThan(17n)
✅ {pass: false} expect(17n).toBeGreaterThan(34n)
✅ {pass: true} expect(17n).toBeLessThanOrEqual(34n)
✅ {pass: false} expect(34n).toBeLessThanOrEqual(17n)
✅ {pass: true} expect(34n).toBeGreaterThanOrEqual(17n)
✅ {pass: false} expect(17n).toBeGreaterThanOrEqual(34n)
✅ throws: [17n, 34n]
✅ {pass: true} expect(-1).toBeLessThan(2n)
✅ {pass: false} expect(2n).toBeLessThan(-1)
✅ {pass: true} expect(2n).toBeGreaterThan(-1)
✅ {pass: false} expect(-1).toBeGreaterThan(2n)
✅ {pass: true} expect(-1).toBeLessThanOrEqual(2n)
✅ {pass: false} expect(2n).toBeLessThanOrEqual(-1)
✅ {pass: true} expect(2n).toBeGreaterThanOrEqual(-1)
✅ {pass: false} expect(-1).toBeGreaterThanOrEqual(2n)
✅ throws: [-1, 2n]
✅ equal numbers: [1, 1]
✅ equal numbers: [5e-324, 5e-324]
✅ equal numbers: [1.7976931348623157e+308, 1.7976931348623157e+308]
✅ equal numbers: [Infinity, Infinity]
✅ equal numbers: [-Infinity, -Infinity]
✅ equal numbers: [1, 1]
✅ equal numbers: [9007199254740991, 9007199254740991]
.toContain(), .toContainEqual()
✅ iterable
✅ '[1, 2, 3, 4]' contains '1'
✅ '["a", "b", "c", "d"]' contains '"a"'
✅ '[undefined, null]' contains 'null'
✅ '[undefined, null]' contains 'undefined'
✅ '[Symbol(a)]' contains 'Symbol(a)'
✅ '"abcdef"' contains '"abc"'
✅ '"11112111"' contains '"2"'
✅ 'Set {"abc", "def"}' contains '"abc"'
✅ '[0, 1]' contains '1'
✅ '[1n, 2n, 3n, 4n]' contains '1n'
✅ '[1, 2, 3, 3n, 4]' contains '3n'
✅ '[1, 2, 3]' does not contain '4'
✅ '[null, undefined]' does not contain '1'
✅ '[{}, []]' does not contain '[]'
✅ '[{}, []]' does not contain '{}'
✅ '[1n, 2n, 3n]' does not contain '3'
✅ error cases
✅ '[1, 2, 3, 4]' contains a value equal to '1'
✅ '["a", "b", "c", "d"]' contains a value equal to '"a"'
✅ '[undefined, null]' contains a value equal to 'null'
✅ '[undefined, null]' contains a value equal to 'undefined'
✅ '[Symbol(a)]' contains a value equal to 'Symbol(a)'
✅ '[{"a": "b"}, {"a": "c"}]' contains a value equal to '{"a": "b"}'
✅ 'Set {1, 2, 3, 4}' contains a value equal to '1'
✅ '[0, 1]' contains a value equal to '1'
✅ '[{"a": "b"}, {"a": "c"}]' does not contain a value equal to'{"a": "d"}'
✅ error cases for toContainEqual
.toBeCloseTo
✅ {pass: true} expect(0).toBeCloseTo(0)
✅ {pass: true} expect(0).toBeCloseTo(0.001)
✅ {pass: true} expect(1.23).toBeCloseTo(1.229)
✅ {pass: true} expect(1.23).toBeCloseTo(1.226)
✅ {pass: true} expect(1.23).toBeCloseTo(1.225)
✅ {pass: true} expect(1.23).toBeCloseTo(1.234)
✅ {pass: true} expect(Infinity).toBeCloseTo(Infinity)
✅ {pass: true} expect(-Infinity).toBeCloseTo(-Infinity)
✅ {pass: false} expect(0).toBeCloseTo(0.01)
✅ {pass: false} expect(1).toBeCloseTo(1.23)
✅ {pass: false} expect(1.23).toBeCloseTo(1.2249999)
✅ {pass: false} expect(Infinity).toBeCloseTo(-Infinity)
✅ {pass: false} expect(Infinity).toBeCloseTo(1.23)
✅ {pass: false} expect(-Infinity).toBeCloseTo(-1.23)
✅ {pass: false} expect(3.141592e-7).toBeCloseTo(3e-7, 8)
✅ {pass: false} expect(56789).toBeCloseTo(51234, -4)
✅ {pass: true} expect(0).toBeCloseTo(0.1, 0)
✅ {pass: true} expect(0).toBeCloseTo(0.0001, 3)
✅ {pass: true} expect(0).toBeCloseTo(0.000004, 5)
✅ {pass: true} expect(2.0000002).toBeCloseTo(2, 5)
.toBeCloseTo throws: Matcher error
✅ promise empty isNot false received
✅ promise empty isNot true expected
✅ promise rejects isNot false expected
✅ promise rejects isNot true received
✅ promise resolves isNot false received
✅ promise resolves isNot true expected
.toMatch()
✅ {pass: true} expect(foo).toMatch(foo)
✅ {pass: true} expect(Foo bar).toMatch(/^foo/i)
✅ throws: [bar, foo]
✅ throws: [bar, /foo/]
✅ throws if non String actual value passed: [1, "foo"]
✅ throws if non String actual value passed: [{}, "foo"]
✅ throws if non String actual value passed: [[], "foo"]
✅ throws if non String actual value passed: [true, "foo"]
✅ throws if non String actual value passed: [/foo/i, "foo"]
✅ throws if non String actual value passed: [[Function anonymous], "foo"]
✅ throws if non String actual value passed: [undefined, "foo"]
✅ throws if non String/RegExp expected value passed: ["foo", 1]
✅ throws if non String/RegExp expected value passed: ["foo", {}]
✅ throws if non String/RegExp expected value passed: ["foo", []]
✅ throws if non String/RegExp expected value passed: ["foo", true]
✅ throws if non String/RegExp expected value passed: ["foo", [Function anonymous]]
✅ throws if non String/RegExp expected value passed: ["foo", undefined]
✅ escapes strings properly
✅ does not maintain RegExp state between calls
.toHaveLength
✅ {pass: true} expect([1, 2]).toHaveLength(2)
✅ {pass: true} expect([]).toHaveLength(0)
✅ {pass: true} expect(["a", "b"]).toHaveLength(2)
✅ {pass: true} expect("abc").toHaveLength(3)
✅ {pass: true} expect("").toHaveLength(0)
✅ {pass: true} expect([Function anonymous]).toHaveLength(0)
✅ {pass: false} expect([1, 2]).toHaveLength(3)
✅ {pass: false} expect([]).toHaveLength(1)
✅ {pass: false} expect(["a", "b"]).toHaveLength(99)
✅ {pass: false} expect("abc").toHaveLength(66)
✅ {pass: false} expect("").toHaveLength(1)
✅ error cases
.toHaveLength matcher error expected length
✅ not number
✅ number Infinity
✅ number NaN
✅ number float
✅ number negative integer
.toHaveProperty()
✅ {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d', 1)
✅ {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d', 1)
✅ {pass: true} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 1)
✅ {pass: true} expect({"a": {"b": [1, 2, 3]}}).toHaveProperty('a,b,1', 2)
✅ {pass: true} expect({"a": {"b": [1, 2, 3]}}).toHaveProperty('a,b,1', Any)
✅ {pass: true} expect({"a": 0}).toHaveProperty('a', 0)
✅ {pass: true} expect({"a": {"b": undefined}}).toHaveProperty('a.b', undefined)
✅ {pass: true} expect({"a": {}}).toHaveProperty('a.b', undefined)
✅ {pass: true} expect({"a": {"b": {"c": 5}}}).toHaveProperty('a.b', {"c": 5})
✅ {pass: true} expect({"property": 1}).toHaveProperty('property', 1)
✅ {pass: true} expect({}).toHaveProperty('a', undefined)
✅ {pass: true} expect({}).toHaveProperty('b', "b")
✅ {pass: true} expect({}).toHaveProperty('setter', undefined)
✅ {pass: true} expect({"val": true}).toHaveProperty('a', undefined)
✅ {pass: true} expect({"val": true}).toHaveProperty('c', "c")
✅ {pass: true} expect({"val": true}).toHaveProperty('val', true)
✅ {pass: true} expect({"nodeName": "DIV"}).toHaveProperty('nodeType', 1)
✅ {pass: true} expect("").toHaveProperty('length', 0)
✅ {pass: true} expect([Function memoized]).toHaveProperty('memo', [])
✅ {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.ttt.d', 1)
✅ {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d', 2)
✅ {pass: false} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 2)
✅ {pass: false} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 2)
✅ {pass: false} expect({"children": ["\"That cartoon\""], "props": null, "type": "p"}).toHaveProperty('children,0', "\"That cat cartoon\"")
✅ {pass: false} expect({"children": ["Roses are red.
Violets are blue.
Testing with Jest is good for you."], "props": null, "type": "pre"}).toHaveProperty('children,0', "Roses are red, violets are blue.
Testing with Jest
Is good for you.")
✅ {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d', 2)
✅ {pass: false} expect({"a": {"b": {"c": {}}}}).toHaveProperty('a.b.c.d', 1)
✅ {pass: false} expect({"a": 1}).toHaveProperty('a.b.c.d', 5)
✅ {pass: false} expect({}).toHaveProperty('a', "test")
✅ {pass: false} expect({"a": {"b": 3}}).toHaveProperty('a.b', undefined)
✅ {pass: false} expect(1).toHaveProperty('a.b.c', "test")
✅ {pass: false} expect("abc").toHaveProperty('a.b.c', {"a": 5})
✅ {pass: false} expect({"a": {"b": {"c": 5}}}).toHaveProperty('a.b', {"c": 4})
✅ {pass: false} expect({}).toHaveProperty('a', "a")
✅ {pass: false} expect({}).toHaveProperty('b', undefined)
✅ {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d')
✅ {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d')
✅ {pass: true} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d')
✅ {pass: true} expect({"a": {"b": [1, 2, 3]}}).toHaveProperty('a,b,1')
✅ {pass: true} expect({"a": 0}).toHaveProperty('a')
✅ {pass: true} expect({"a": {"b": undefined}}).toHaveProperty('a.b')
✅ {pass: false} expect({"a": {"b": {"c": {}}}}).toHaveProperty('a.b.c.d')
✅ {pass: false} expect({"a": 1}).toHaveProperty('a.b.c.d')
✅ {pass: false} expect({}).toHaveProperty('a')
✅ {pass: false} expect(1).toHaveProperty('a.b.c')
✅ {pass: false} expect("abc").toHaveProperty('a.b.c')
✅ {pass: false} expect(false).toHaveProperty('key')
✅ {pass: false} expect(0).toHaveProperty('key')
✅ {pass: false} expect("").toHaveProperty('key')
✅ {pass: false} expect(Symbol()).toHaveProperty('key')
✅ {pass: false} expect({"key": 1}).toHaveProperty('not')
✅ {error} expect(null).toHaveProperty('a.b')
✅ {error} expect(undefined).toHaveProperty('a')
✅ {error} expect({"a": {"b": {}}}).toHaveProperty('undefined')
✅ {error} expect({"a": {"b": {}}}).toHaveProperty('null')
✅ {error} expect({"a": {"b": {}}}).toHaveProperty('1')
✅ {error} expect({}).toHaveProperty('')
toMatchObject() circular references simple circular references
✅ {pass: true} expect({"a": "hello", "ref": [Circular]}).toMatchObject({})
✅ {pass: true} expect({"a": "hello", "ref": [Circular]}).toMatchObject({"a": "hello", "ref": [Circular]})
✅ {pass: false} expect({}).toMatchObject({"a": "hello", "ref": [Circular]})
✅ {pass: false} expect({"a": "hello", "ref": [Circular]}).toMatchObject({"a": "world", "ref": [Circular]})
✅ {pass: false} expect({"ref": "not a ref"}).toMatchObject({"a": "hello", "ref": [Circular]})
toMatchObject() circular references transitive circular references
✅ {pass: true} expect({"a": "hello", "nestedObj": {"parentObj": [Circular]}}).toMatchObject({})
✅ {pass: true} expect({"a": "hello", "nestedObj": {"parentObj": [Circular]}}).toMatchObject({"a": "hello", "nestedObj": {"parentObj": [Circular]}})
✅ {pass: false} expect({}).toMatchObject({"a": "hello", "nestedObj": {"parentObj": [Circular]}})
✅ {pass: false} expect({"a": "world", "nestedObj": {"parentObj": [Circular]}}).toMatchObject({"a": "hello", "nestedObj": {"parentObj": [Circular]}})
✅ {pass: false} expect({"nestedObj": {"parentObj": "not the parent ref"}}).toMatchObject({"a": "hello", "nestedObj": {"parentObj": [Circular]}})
toMatchObject()
✅ {pass: true} expect({"a": "b", "c": "d"}).toMatchObject({"a": "b"})
✅ {pass: true} expect({"a": "b", "c": "d"}).toMatchObject({"a": "b", "c": "d"})
✅ {pass: true} expect({"a": "b", "t": {"x": {"r": "r"}, "z": "z"}}).toMatchObject({"a": "b", "t": {"z": "z"}})
✅ {pass: true} expect({"a": "b", "t": {"x": {"r": "r"}, "z": "z"}}).toMatchObject({"t": {"x": {"r": "r"}}})
✅ {pass: true} expect({"a": [3, 4, 5], "b": "b"}).toMatchObject({"a": [3, 4, 5]})
✅ {pass: true} expect({"a": [3, 4, 5, "v"], "b": "b"}).toMatchObject({"a": [3, 4, 5, "v"]})
✅ {pass: true} expect({"a": 1, "c": 2}).toMatchObject({"a": Any})
✅ {pass: true} expect({"a": {"x": "x", "y": "y"}}).toMatchObject({"a": {"x": Any}})
✅ {pass: true} expect(Set {1, 2}).toMatchObject(Set {1, 2})
✅ {pass: true} expect(Set {1, 2}).toMatchObject(Set {2, 1})
✅ {pass: true} expect(2015-11-30T00:00:00.000Z).toMatchObject(2015-11-30T00:00:00.000Z)
✅ {pass: true} expect({"a": 2015-11-30T00:00:00.000Z, "b": "b"}).toMatchObject({"a": 2015-11-30T00:00:00.000Z})
✅ {pass: true} expect({"a": null, "b": "b"}).toMatchObject({"a": null})
✅ {pass: true} expect({"a": undefined, "b": "b"}).toMatchObject({"a": undefined})
✅ {pass: true} expect({"a": [{"a": "a", "b": "b"}]}).toMatchObject({"a": [{"a": "a"}]})
✅ {pass: true} expect([1, 2]).toMatchObject([1, 2])
✅ {pass: true} expect({"a": undefined}).toMatchObject({"a": undefined})
✅ {pass: true} expect([]).toMatchObject([])
✅ {pass: true} expect([Error: foo]).toMatchObject([Error: foo])
✅ {pass: true} expect([Error: bar]).toMatchObject({"message": "bar"})
✅ {pass: true} expect({}).toMatchObject({"a": undefined, "b": "b"})
✅ {pass: true} expect({"a": "b"}).toMatchObject({"a": "b"})
✅ {pass: true} expect({"a": "b", "c": "d", Symbol(jest): "jest"}).toMatchObject({"a": "b", Symbol(jest): "jest"})
✅ {pass: true} expect({"a": "b", "c": "d", Symbol(jest): "jest"}).toMatchObject({"a": "b", "c": "d", Symbol(jest): "jest"})
✅ {pass: true} expect({}).toMatchObject({"a": undefined, "b": "b", "c": "c"})
✅ {pass: true} expect({}).toMatchObject({"d": 4})
✅ {pass: true} expect({"a": "b", "toString": [Function toString]}).toMatchObject({"toString": Any})
✅ {pass: false} expect({"a": "b", "c": "d"}).toMatchObject({"e": "b"})
✅ {pass: false} expect({"a": "b", "c": "d"}).toMatchObject({"a": "b!", "c": "d"})
✅ {pass: false} expect({"a": "a", "c": "d"}).toMatchObject({"a": Any})
✅ {pass: false} expect({"a": "b", "t": {"x": {"r": "r"}, "z": "z"}}).toMatchObject({"a": "b", "t": {"z": [3]}})
✅ {pass: false} expect({"a": "b", "t": {"x": {"r": "r"}, "z": "z"}}).toMatchObject({"t": {"l": {"r": "r"}}})
✅ {pass: false} expect({"a": [3, 4, 5], "b": "b"}).toMatchObject({"a": [3, 4, 5, 6]})
✅ {pass: false} expect({"a": [3, 4, 5], "b": "b"}).toMatchObject({"a": [3, 4]})
✅ {pass: false} expect({"a": [3, 4, "v"], "b": "b"}).toMatchObject({"a": ["v"]})
✅ {pass: false} expect({"a": [3, 4, 5], "b": "b"}).toMatchObject({"a": {"b": 4}})
✅ {pass: false} expect({"a": [3, 4, 5], "b": "b"}).toMatchObject({"a": {"b": Any}})
✅ {pass: false} expect([1, 2]).toMatchObject([1, 3])
✅ {pass: false} expect([0]).toMatchObject([-0])
✅ {pass: false} expect(Set {1, 2}).toMatchObject(Set {2})
✅ {pass: false} expect(2015-11-30T00:00:00.000Z).toMatchObject(2015-10-10T00:00:00.000Z)
✅ {pass: false} expect({"a": 2015-11-30T00:00:00.000Z, "b": "b"}).toMatchObject({"a": 2015-10-10T00:00:00.000Z})
✅ {pass: false} expect({"a": null, "b": "b"}).toMatchObject({"a": "4"})
✅ {pass: false} expect({"a": null, "b": "b"}).toMatchObject({"a": undefined})
✅ {pass: false} expect({"a": undefined}).toMatchObject({"a": null})
✅ {pass: false} expect({"a": [{"a": "a", "b": "b"}]}).toMatchObject({"a": [{"a": "c"}]})
✅ {pass: false} expect({"a": 1, "b": 1, "c": 1, "d": {"e": {"f": 555}}}).toMatchObject({"d": {"e": {"f": 222}}})
✅ {pass: false} expect({}).toMatchObject({"a": undefined})
✅ {pass: false} expect([1, 2, 3]).toMatchObject([2, 3, 1])
✅ {pass: false} expect([1, 2, 3]).toMatchObject([1, 2, 2])
✅ {pass: false} expect([Error: foo]).toMatchObject([Error: bar])
✅ {pass: false} expect({"a": "b"}).toMatchObject({"c": "d"})
✅ {pass: false} expect({"a": "b", "c": "d", Symbol(jest): "jest"}).toMatchObject({"a": "c", Symbol(jest): Any})
✅ {pass: false} expect({"a": "b"}).toMatchObject({"toString": Any})
✅ throws expect(null).toMatchObject({})
✅ throws expect(4).toMatchObject({})
✅ throws expect("44").toMatchObject({})
✅ throws expect(true).toMatchObject({})
✅ throws expect(undefined).toMatchObject({})
✅ throws expect({}).toMatchObject(null)
✅ throws expect({}).toMatchObject(4)
✅ throws expect({}).toMatchObject("some string")
✅ throws expect({}).toMatchObject(true)
✅ throws expect({}).toMatchObject(undefined)
✅ does not match properties up in the prototype chain
```
### ✅ packages/expect/src/__tests__/spyMatchers.test.ts
```
toBeCalled
✅ works only on spies or jest.fn
✅ passes when called
✅ .not passes when called
✅ fails with any argument passed
✅ .not fails with any argument passed
✅ includes the custom mock name in the error message
toHaveBeenCalled
✅ works only on spies or jest.fn
✅ passes when called
✅ .not passes when called
✅ fails with any argument passed
✅ .not fails with any argument passed
✅ includes the custom mock name in the error message
toBeCalledTimes
✅ .not works only on spies or jest.fn
✅ only accepts a number argument
✅ .not only accepts a number argument
✅ passes if function called equal to expected times
✅ .not passes if function called more than expected times
✅ .not passes if function called less than expected times
✅ includes the custom mock name in the error message
toHaveBeenCalledTimes
✅ .not works only on spies or jest.fn
✅ only accepts a number argument
✅ .not only accepts a number argument
✅ passes if function called equal to expected times
✅ .not passes if function called more than expected times
✅ .not passes if function called less than expected times
✅ includes the custom mock name in the error message
lastCalledWith
✅ works only on spies or jest.fn
✅ works when not called
✅ works with no arguments
✅ works with arguments that don't match
✅ works with arguments that match
✅ works with trailing undefined arguments
✅ works with Map
✅ works with Set
✅ works with Immutable.js objects
✅ works with many arguments
✅ works with many arguments that don't match
✅ includes the custom mock name in the error message
toHaveBeenLastCalledWith
✅ works only on spies or jest.fn
✅ works when not called
✅ works with no arguments
✅ works with arguments that don't match
✅ works with arguments that match
✅ works with trailing undefined arguments
✅ works with Map
✅ works with Set
✅ works with Immutable.js objects
✅ works with many arguments
✅ works with many arguments that don't match
✅ includes the custom mock name in the error message
nthCalledWith
✅ works only on spies or jest.fn
✅ works when not called
✅ works with no arguments
✅ works with arguments that don't match
✅ works with arguments that match
✅ works with trailing undefined arguments
✅ works with Map
✅ works with Set
✅ works with Immutable.js objects
✅ works with three calls
✅ positive throw matcher error for n that is not positive integer
✅ positive throw matcher error for n that is not integer
✅ negative throw matcher error for n that is not integer
✅ includes the custom mock name in the error message
toHaveBeenNthCalledWith
✅ works only on spies or jest.fn
✅ works when not called
✅ works with no arguments
✅ works with arguments that don't match
✅ works with arguments that match
✅ works with trailing undefined arguments
✅ works with Map
✅ works with Set
✅ works with Immutable.js objects
✅ works with three calls
✅ positive throw matcher error for n that is not positive integer
✅ positive throw matcher error for n that is not integer
✅ negative throw matcher error for n that is not integer
✅ includes the custom mock name in the error message
toBeCalledWith
✅ works only on spies or jest.fn
✅ works when not called
✅ works with no arguments
✅ works with arguments that don't match
✅ works with arguments that match
✅ works with trailing undefined arguments
✅ works with Map
✅ works with Set
✅ works with Immutable.js objects
✅ works with many arguments
✅ works with many arguments that don't match
✅ includes the custom mock name in the error message
toHaveBeenCalledWith
✅ works only on spies or jest.fn
✅ works when not called
✅ works with no arguments
✅ works with arguments that don't match
✅ works with arguments that match
✅ works with trailing undefined arguments
✅ works with Map
✅ works with Set
✅ works with Immutable.js objects
✅ works with many arguments
✅ works with many arguments that don't match
✅ includes the custom mock name in the error message
toReturn
✅ .not works only on jest.fn
✅ throw matcher error if received is spy
✅ passes when returned
✅ passes when undefined is returned
✅ passes when at least one call does not throw
✅ .not passes when not returned
✅ .not passes when all calls throw
✅ .not passes when a call throws undefined
✅ fails with any argument passed
✅ .not fails with any argument passed
✅ includes the custom mock name in the error message
✅ incomplete recursive calls are handled properly
toHaveReturned
✅ .not works only on jest.fn
✅ throw matcher error if received is spy
✅ passes when returned
✅ passes when undefined is returned
✅ passes when at least one call does not throw
✅ .not passes when not returned
✅ .not passes when all calls throw
✅ .not passes when a call throws undefined
✅ fails with any argument passed
✅ .not fails with any argument passed
✅ includes the custom mock name in the error message
✅ incomplete recursive calls are handled properly
toReturnTimes
✅ throw matcher error if received is spy
✅ only accepts a number argument
✅ .not only accepts a number argument
✅ passes if function returned equal to expected times
✅ calls that return undefined are counted as returns
✅ .not passes if function returned more than expected times
✅ .not passes if function called less than expected times
✅ calls that throw are not counted
✅ calls that throw undefined are not counted
✅ includes the custom mock name in the error message
✅ incomplete recursive calls are handled properly
toHaveReturnedTimes
✅ throw matcher error if received is spy
✅ only accepts a number argument
✅ .not only accepts a number argument
✅ passes if function returned equal to expected times
✅ calls that return undefined are counted as returns
✅ .not passes if function returned more than expected times
✅ .not passes if function called less than expected times
✅ calls that throw are not counted
✅ calls that throw undefined are not counted
✅ includes the custom mock name in the error message
✅ incomplete recursive calls are handled properly
lastReturnedWith
✅ works only on spies or jest.fn
✅ works when not called
✅ works with no arguments
✅ works with argument that does not match
✅ works with argument that does match
✅ works with undefined
✅ works with Map
✅ works with Set
✅ works with Immutable.js objects directly created
✅ works with Immutable.js objects indirectly created
✅ a call that throws is not considered to have returned
✅ a call that throws undefined is not considered to have returned
✅ includes the custom mock name in the error message
lastReturnedWith lastReturnedWith
✅ works with three calls
✅ incomplete recursive calls are handled properly
toHaveLastReturnedWith
✅ works only on spies or jest.fn
✅ works when not called
✅ works with no arguments
✅ works with argument that does not match
✅ works with argument that does match
✅ works with undefined
✅ works with Map
✅ works with Set
✅ works with Immutable.js objects directly created
✅ works with Immutable.js objects indirectly created
✅ a call that throws is not considered to have returned
✅ a call that throws undefined is not considered to have returned
✅ includes the custom mock name in the error message
toHaveLastReturnedWith lastReturnedWith
✅ works with three calls
✅ incomplete recursive calls are handled properly
nthReturnedWith
✅ works only on spies or jest.fn
✅ works when not called
✅ works with no arguments
✅ works with argument that does not match
✅ works with argument that does match
✅ works with undefined
✅ works with Map
✅ works with Set
✅ works with Immutable.js objects directly created
✅ works with Immutable.js objects indirectly created
✅ a call that throws is not considered to have returned
✅ a call that throws undefined is not considered to have returned
✅ includes the custom mock name in the error message
nthReturnedWith nthReturnedWith
✅ works with three calls
✅ should replace 1st, 2nd, 3rd with first, second, third
✅ positive throw matcher error for n that is not positive integer
✅ should reject nth value greater than number of calls
✅ positive throw matcher error for n that is not integer
✅ negative throw matcher error for n that is not number
✅ incomplete recursive calls are handled properly
toHaveNthReturnedWith
✅ works only on spies or jest.fn
✅ works when not called
✅ works with no arguments
✅ works with argument that does not match
✅ works with argument that does match
✅ works with undefined
✅ works with Map
✅ works with Set
✅ works with Immutable.js objects directly created
✅ works with Immutable.js objects indirectly created
✅ a call that throws is not considered to have returned
✅ a call that throws undefined is not considered to have returned
✅ includes the custom mock name in the error message
toHaveNthReturnedWith nthReturnedWith
✅ works with three calls
✅ should replace 1st, 2nd, 3rd with first, second, third
✅ positive throw matcher error for n that is not positive integer
✅ should reject nth value greater than number of calls
✅ positive throw matcher error for n that is not integer
✅ negative throw matcher error for n that is not number
✅ incomplete recursive calls are handled properly
toReturnWith
✅ works only on spies or jest.fn
✅ works when not called
✅ works with no arguments
✅ works with argument that does not match
✅ works with argument that does match
✅ works with undefined
✅ works with Map
✅ works with Set
✅ works with Immutable.js objects directly created
✅ works with Immutable.js objects indirectly created
✅ a call that throws is not considered to have returned
✅ a call that throws undefined is not considered to have returned
✅ includes the custom mock name in the error message
toReturnWith returnedWith
✅ works with more calls than the limit
✅ incomplete recursive calls are handled properly
toHaveReturnedWith
✅ works only on spies or jest.fn
✅ works when not called
✅ works with no arguments
✅ works with argument that does not match
✅ works with argument that does match
✅ works with undefined
✅ works with Map
✅ works with Set
✅ works with Immutable.js objects directly created
✅ works with Immutable.js objects indirectly created
✅ a call that throws is not considered to have returned
✅ a call that throws undefined is not considered to have returned
✅ includes the custom mock name in the error message
toHaveReturnedWith returnedWith
✅ works with more calls than the limit
✅ incomplete recursive calls are handled properly
```
### ✅ packages/expect/src/__tests__/stacktrace.test.ts
```
✅ stack trace points to correct location when using matchers
✅ stack trace points to correct location when using nested matchers
✅ stack trace points to correct location when throwing from a custom matcher
```
### ✅ packages/expect/src/__tests__/symbolInObjects.test.ts
```
Symbol in objects
✅ should compare objects with Symbol keys
✅ should compare objects with mixed keys and Symbol
✅ should compare objects with different Symbol keys
```
### ✅ packages/expect/src/__tests__/toEqual-dom.test.ts
```
toEqual duck type Text
✅ isNot false
✅ isNot true
toEqual duck type Element
✅ isNot false
✅ isNot true
toEqual duck type Fragment
✅ isNot false
✅ isNot true
toEqual document createTextNode
✅ isNot false
✅ isNot true
toEqual document createElement
✅ isNot false
✅ isNot true
toEqual document createDocumentFragment
✅ isNot false
✅ isNot true
```
### ✅ packages/expect/src/__tests__/toThrowMatchers.test.ts
```
toThrowError
✅ to throw or not to throw
✅ invalid arguments
✅ invalid actual
toThrowError substring
✅ passes
✅ did not throw at all
✅ threw, but message did not match (error)
✅ threw, but message did not match (non-error falsey)
✅ properly escapes strings when matching against errors
✅ threw, but message should not match (error)
✅ threw, but message should not match (non-error truthy)
toThrowError regexp
✅ passes
✅ did not throw at all
✅ threw, but message did not match (error)
✅ threw, but message did not match (non-error falsey)
✅ threw, but message should not match (error)
✅ threw, but message should not match (non-error truthy)
toThrowError error class
✅ passes
✅ did not throw at all
✅ threw, but class did not match (error)
✅ threw, but class did not match (non-error falsey)
✅ threw, but class should not match (error)
✅ threw, but class should not match (error subclass)
✅ threw, but class should not match (error subsubclass)
toThrowError error-message pass
✅ isNot false
✅ isNot true
toThrowError error-message fail
✅ isNot false
✅ isNot true
✅ multiline diff highlight incorrect expected space
toThrowError asymmetric any-Class pass
✅ isNot false
✅ isNot true
toThrowError asymmetric any-Class fail
✅ isNot false
✅ isNot true
toThrowError asymmetric anything pass
✅ isNot false
✅ isNot true
toThrowError asymmetric anything fail
✅ isNot false
✅ isNot true
toThrowError asymmetric no-symbol pass
✅ isNot false
✅ isNot true
toThrowError asymmetric no-symbol fail
✅ isNot false
✅ isNot true
toThrowError asymmetric objectContaining pass
✅ isNot false
✅ isNot true
toThrowError asymmetric objectContaining fail
✅ isNot false
✅ isNot true
toThrowError promise/async throws if Error-like object is returned
✅ passes
✅ did not throw at all
✅ threw, but class did not match
✅ threw, but should not have
toThrowError expected is undefined
✅ threw, but should not have (non-error falsey)
toThrow
✅ to throw or not to throw
✅ invalid arguments
✅ invalid actual
toThrow substring
✅ passes
✅ did not throw at all
✅ threw, but message did not match (error)
✅ threw, but message did not match (non-error falsey)
✅ properly escapes strings when matching against errors
✅ threw, but message should not match (error)
✅ threw, but message should not match (non-error truthy)
toThrow regexp
✅ passes
✅ did not throw at all
✅ threw, but message did not match (error)
✅ threw, but message did not match (non-error falsey)
✅ threw, but message should not match (error)
✅ threw, but message should not match (non-error truthy)
toThrow error class
✅ passes
✅ did not throw at all
✅ threw, but class did not match (error)
✅ threw, but class did not match (non-error falsey)
✅ threw, but class should not match (error)
✅ threw, but class should not match (error subclass)
✅ threw, but class should not match (error subsubclass)
toThrow error-message pass
✅ isNot false
✅ isNot true
toThrow error-message fail
✅ isNot false
✅ isNot true
✅ multiline diff highlight incorrect expected space
toThrow asymmetric any-Class pass
✅ isNot false
✅ isNot true
toThrow asymmetric any-Class fail
✅ isNot false
✅ isNot true
toThrow asymmetric anything pass
✅ isNot false
✅ isNot true
toThrow asymmetric anything fail
✅ isNot false
✅ isNot true
toThrow asymmetric no-symbol pass
✅ isNot false
✅ isNot true
toThrow asymmetric no-symbol fail
✅ isNot false
✅ isNot true
toThrow asymmetric objectContaining pass
✅ isNot false
✅ isNot true
toThrow asymmetric objectContaining fail
✅ isNot false
✅ isNot true
toThrow promise/async throws if Error-like object is returned
✅ passes
✅ did not throw at all
✅ threw, but class did not match
✅ threw, but should not have
toThrow expected is undefined
✅ threw, but should not have (non-error falsey)
```
### ✅ packages/expect/src/__tests__/utils.test.ts
```
getPath()
✅ property exists
✅ property doesnt exist
✅ property exist but undefined
✅ property is a getter on class instance
✅ property is inherited
✅ path breaks
✅ empty object at the end
getObjectSubset
✅ expect(getObjectSubset({"a": "b", "c": "d"}, {"a": "d"})).toEqual({"a": "b"})
✅ expect(getObjectSubset({"a": [1, 2], "b": "b"}, {"a": [3, 4]})).toEqual({"a": [1, 2]})
✅ expect(getObjectSubset([{"a": "b", "c": "d"}], [{"a": "z"}])).toEqual([{"a": "b"}])
✅ expect(getObjectSubset([1, 2], [1, 2, 3])).toEqual([1, 2])
✅ expect(getObjectSubset({"a": [1]}, {"a": [1, 2]})).toEqual({"a": [1]})
✅ expect(getObjectSubset(2015-11-30T00:00:00.000Z, 2016-12-30T00:00:00.000Z)).toEqual(2015-11-30T00:00:00.000Z)
getObjectSubset returns the object instance if the subset has no extra properties
✅ Date
getObjectSubset returns the subset instance if its property values are equal
✅ Object
getObjectSubset returns the subset instance if its property values are equal Uint8Array
✅ expected
✅ received
getObjectSubset calculating subsets of objects with circular references
✅ simple circular references
✅ transitive circular references
emptyObject()
✅ matches an empty object
✅ does not match an object with keys
✅ does not match a non-object
subsetEquality()
✅ matching object returns true
✅ object without keys is undefined
✅ objects to not match
✅ null does not return errors
✅ undefined does not return errors
subsetEquality() matching subsets with circular references
✅ simple circular references
✅ referenced object on same level should not regarded as circular reference
✅ transitive circular references
iterableEquality
✅ returns true when given circular iterators
✅ returns true when given circular Set
✅ returns true when given nested Sets
✅ returns false when given inequal set within a set
✅ returns false when given inequal map within a set
✅ returns false when given inequal set within a map
✅ returns true when given circular Set shape
✅ returns true when given circular key in Map
✅ returns true when given nested Maps
✅ returns true when given circular key and value in Map
✅ returns true when given circular value in Map
```
### ✅ packages/jest-circus/src/__tests__/afterAll.test.ts
```
✅ tests are not marked done until their parent afterAll runs
✅ describe block cannot have hooks and no tests
✅ describe block _can_ have hooks if a child describe block has tests
✅ describe block hooks must not run if describe block is skipped
✅ child tests marked with todo should not run if describe block is skipped
✅ child tests marked with only should not run if describe block is skipped
```
### ✅ packages/jest-circus/src/__tests__/baseTest.test.ts
```
✅ simple test
✅ failures
```
### ✅ packages/jest-circus/src/__tests__/circusItTestError.test.ts
```
test/it error throwing
✅ it doesn't throw an error with valid arguments
✅ it throws error with missing callback function
✅ it throws an error when first argument isn't a string
✅ it throws an error when callback function is not a function
✅ test doesn't throw an error with valid arguments
✅ test throws error with missing callback function
✅ test throws an error when first argument isn't a string
✅ test throws an error when callback function is not a function
```
### ✅ packages/jest-circus/src/__tests__/circusItTodoTestError.test.ts
```
test/it.todo error throwing
✅ todo throws error when given no arguments
✅ todo throws error when given more than one argument
✅ todo throws error when given none string description
```
### ✅ packages/jest-circus/src/__tests__/hooks.test.ts
```
✅ beforeEach is executed before each test in current/child describe blocks
✅ multiple before each hooks in one describe are executed in the right order
✅ beforeAll is exectued correctly
```
### ✅ packages/jest-circus/src/__tests__/hooksError.test.ts
```
beforeEach hooks error throwing
✅ beforeEach throws an error when "String" is provided as a first argument to it
✅ beforeEach throws an error when 1 is provided as a first argument to it
✅ beforeEach throws an error when [] is provided as a first argument to it
✅ beforeEach throws an error when {} is provided as a first argument to it
✅ beforeEach throws an error when Symbol(hello) is provided as a first argument to it
✅ beforeEach throws an error when true is provided as a first argument to it
✅ beforeEach throws an error when null is provided as a first argument to it
✅ beforeEach throws an error when undefined is provided as a first argument to it
beforeAll hooks error throwing
✅ beforeAll throws an error when "String" is provided as a first argument to it
✅ beforeAll throws an error when 1 is provided as a first argument to it
✅ beforeAll throws an error when [] is provided as a first argument to it
✅ beforeAll throws an error when {} is provided as a first argument to it
✅ beforeAll throws an error when Symbol(hello) is provided as a first argument to it
✅ beforeAll throws an error when true is provided as a first argument to it
✅ beforeAll throws an error when null is provided as a first argument to it
✅ beforeAll throws an error when undefined is provided as a first argument to it
afterEach hooks error throwing
✅ afterEach throws an error when "String" is provided as a first argument to it
✅ afterEach throws an error when 1 is provided as a first argument to it
✅ afterEach throws an error when [] is provided as a first argument to it
✅ afterEach throws an error when {} is provided as a first argument to it
✅ afterEach throws an error when Symbol(hello) is provided as a first argument to it
✅ afterEach throws an error when true is provided as a first argument to it
✅ afterEach throws an error when null is provided as a first argument to it
✅ afterEach throws an error when undefined is provided as a first argument to it
afterAll hooks error throwing
✅ afterAll throws an error when "String" is provided as a first argument to it
✅ afterAll throws an error when 1 is provided as a first argument to it
✅ afterAll throws an error when [] is provided as a first argument to it
✅ afterAll throws an error when {} is provided as a first argument to it
✅ afterAll throws an error when Symbol(hello) is provided as a first argument to it
✅ afterAll throws an error when true is provided as a first argument to it
✅ afterAll throws an error when null is provided as a first argument to it
✅ afterAll throws an error when undefined is provided as a first argument to it
```
### ✅ packages/jest-cli/src/__tests__/cli/args.test.ts
```
check
✅ returns true if the arguments are valid
✅ raises an exception if runInBand and maxWorkers are both specified
✅ raises an exception if onlyChanged and watchAll are both specified
✅ raises an exception if onlyFailures and watchAll are both specified
✅ raises an exception when lastCommit and watchAll are both specified
✅ raises an exception if findRelatedTests is specified with no file paths
✅ raises an exception if maxWorkers is specified with no number
✅ allows maxWorkers to be a %
✅ allows using "js" file for --config option
✅ allows using "ts" file for --config option
✅ allows using "mjs" file for --config option
✅ allows using "cjs" file for --config option
✅ allows using "json" file for --config option
✅ raises an exception if selectProjects is not provided any project names
✅ raises an exception if config is not a valid JSON string
✅ raises an exception if config is not a supported file type
buildArgv
✅ should return only camelcased args
```
### ✅ packages/jest-cli/src/init/__tests__/init.test.js
```
init project with package.json and no jest config all questions answered with answer: "No"
✅ should return the default configuration (an empty config)
✅ should generate empty config with mjs extension
init project with package.json and no jest config some questions answered with answer: "Yes"
✅ should create configuration for {clearMocks: true}
✅ should create configuration for {coverage: true}
✅ should create configuration for {coverageProvider: "babel"}
✅ should create configuration for {coverageProvider: "v8"}
✅ should create configuration for {environment: "jsdom"}
✅ should create configuration for {environment: "node"}
✅ should create package.json with configured test command when {scripts: true}
init no package json
✅ should throw an error if there is no package.json file
init has-jest-config-file-js ask the user whether to override config or not
✅ user answered with "Yes"
✅ user answered with "No"
init has-jest-config-file-ts ask the user whether to override config or not
✅ user answered with "Yes"
✅ user answered with "No"
init has-jest-config-file-mjs ask the user whether to override config or not
✅ user answered with "Yes"
✅ user answered with "No"
init has-jest-config-file-cjs ask the user whether to override config or not
✅ user answered with "Yes"
✅ user answered with "No"
init has-jest-config-file-json ask the user whether to override config or not
✅ user answered with "Yes"
✅ user answered with "No"
init project using jest.config.ts ask the user whether he wants to use Typescript or not
✅ user answered with "Yes"
✅ user answered with "No"
init has jest config in package.json
✅ should ask the user whether to override config or not
init already has "jest" in packageJson.scripts.test
✅ should not ask "test script question"
```
### ✅ packages/jest-cli/src/init/__tests__/modifyPackageJson.test.ts
```
✅ should remove jest config if exists
✅ should add test script when there are no scripts
✅ should add test script when there are scripts
✅ should not add test script when { shouldModifyScripts: false }
```
### ✅ packages/jest-config/src/__tests__/Defaults.test.ts
```
✅ get configuration defaults
```
### ✅ packages/jest-config/src/__tests__/getMaxWorkers.test.ts
```
getMaxWorkers
✅ Returns 1 when runInBand
✅ Returns 1 when the OS CPUs are not available
✅ Returns the `maxWorkers` when specified
✅ Returns based on the number of cpus
getMaxWorkers % based
✅ 50% = 2 workers
✅ < 0 workers should become 1
✅ 0% shouldn't break
```
### ✅ packages/jest-config/src/__tests__/normalize.test.js
```
✅ picks a name based on the rootDir
✅ keeps custom project name based on the projects rootDir
✅ keeps custom names based on the rootDir
✅ minimal config is stable across runs
✅ sets coverageReporters correctly when argv.json is set
rootDir
✅ throws if the options is missing a rootDir property
automock
✅ falsy automock is not overwritten
collectCoverageOnlyFrom
✅ normalizes all paths relative to rootDir
✅ does not change absolute paths
✅ substitutes tokens
collectCoverageFrom
✅ substitutes tokens
findRelatedTests
✅ it generates --coverageCoverageFrom patterns when needed
roots
✅ normalizes all paths relative to rootDir
✅ does not change absolute paths
✅ substitutes tokens
transform
✅ normalizes the path
✅ pulls in config if it's passed as an array, and defaults to empty object
haste
✅ normalizes the path for hasteImplModulePath
setupFilesAfterEnv
✅ normalizes the path according to rootDir
✅ does not change absolute paths
✅ substitutes tokens
setupTestFrameworkScriptFile
✅ logs a deprecation warning when `setupTestFrameworkScriptFile` is used
✅ logs an error when `setupTestFrameworkScriptFile` and `setupFilesAfterEnv` are used
coveragePathIgnorePatterns
✅ does not normalize paths relative to rootDir
✅ does not normalize trailing slashes
✅ substitutes tokens
watchPathIgnorePatterns
✅ does not normalize paths relative to rootDir
✅ does not normalize trailing slashes
✅ substitutes tokens
testPathIgnorePatterns
✅ does not normalize paths relative to rootDir
✅ does not normalize trailing slashes
✅ substitutes tokens
modulePathIgnorePatterns
✅ does not normalize paths relative to rootDir
✅ does not normalize trailing slashes
✅ substitutes tokens
testRunner
✅ defaults to Circus
✅ resolves jasmine
✅ is overwritten by argv
coverageDirectory
✅ defaults to /coverage
testEnvironment
✅ resolves to an environment and prefers jest-environment-`name`
✅ throws on invalid environment names
✅ works with rootDir
babel-jest
✅ correctly identifies and uses babel-jest
✅ uses babel-jest if babel-jest is explicitly specified in a custom transform options
Upgrade help
✅ logs a warning when `scriptPreprocessor` and/or `preprocessorIgnorePatterns` are used
testRegex
✅ testRegex empty string is mapped to empty array
✅ testRegex string is mapped to an array
✅ testRegex array is preserved
testMatch
✅ testMatch default not applied if testRegex is set
✅ testRegex default not applied if testMatch is set
✅ throws if testRegex and testMatch are both specified
✅ normalizes testMatch
moduleDirectories
✅ defaults to node_modules
✅ normalizes moduleDirectories
preset
✅ throws when preset not found
✅ throws when module was found but no "jest-preset.js" or "jest-preset.json" files
✅ throws when a dependency is missing in the preset
✅ throws when preset is invalid
✅ throws when preset evaluation throws type error
✅ works with "react-native"
✅ searches for .json and .js preset files
✅ merges with options
✅ merges with options and moduleNameMapper preset is overridden by options
✅ merges with options and transform preset is overridden by options
✅ extracts setupFilesAfterEnv from preset
preset with globals
✅ should merge the globals preset correctly
preset without setupFiles
✅ should normalize setupFiles correctly
preset without setupFilesAfterEnv
✅ should normalize setupFilesAfterEnv correctly
runner
✅ defaults to `jest-runner`
✅ resolves to runners that do not have the prefix
✅ resolves to runners and prefers jest-runner-`name`
✅ throw error when a runner is not found
watchPlugins
✅ defaults to undefined
✅ resolves to watch plugins and prefers jest-watch-`name`
✅ resolves watch plugins that do not have the prefix
✅ normalizes multiple watchPlugins
✅ throw error when a watch plugin is not found
testPathPattern
✅ defaults to empty
✅ joins multiple --testPathPatterns and
✅ gives precedence to --all
testPathPattern --testPathPattern
✅ uses --testPathPattern if set
✅ ignores invalid regular expressions and logs a warning
✅ joins multiple --testPathPattern if set
testPathPattern --testPathPattern posix
✅ should not escape the pattern
testPathPattern --testPathPattern win32
✅ preserves any use of "\"
✅ replaces POSIX path separators
✅ replaces POSIX paths in multiple args
✅ coerces all patterns to strings
testPathPattern
✅ uses if set
✅ ignores invalid regular expressions and logs a warning
✅ joins multiple if set
testPathPattern posix
✅ should not escape the pattern
testPathPattern win32
✅ preserves any use of "\"
✅ replaces POSIX path separators
✅ replaces POSIX paths in multiple args
✅ coerces all patterns to strings
moduleFileExtensions
✅ defaults to something useful
✅ throws if missing `js` but using jest-runner
✅ does not throw if missing `js` with a custom runner
cwd
✅ is set to process.cwd
✅ is not lost if the config has its own cwd property
Defaults
✅ should be accepted by normalize
displayName
✅ should throw an error when displayName is is an empty object
✅ should throw an error when displayName is missing color
✅ should throw an error when displayName is missing name
✅ should throw an error when displayName is using invalid values
✅ generates a default color for the runner undefined
✅ generates a default color for the runner jest-runner
✅ generates a default color for the runner jest-runner-eslint
✅ generates a default color for the runner jest-runner-tslint
✅ generates a default color for the runner jest-runner-tsc
testTimeout
✅ should return timeout value if defined
✅ should throw an error if timeout is a negative number
extensionsToTreatAsEsm
✅ should pass valid config through
✅ should enforce leading dots
✅ throws on .js
✅ throws on .mjs
✅ throws on .cjs
```
### ✅ packages/jest-config/src/__tests__/readConfig.test.ts
```
✅ readConfig() throws when an object is passed without a file path
```
### ✅ packages/jest-config/src/__tests__/readConfigs.test.ts
```
✅ readConfigs() throws when called without project paths
✅ readConfigs() loads async config file
✅ readConfigs() reject if async was rejected
```
### ✅ packages/jest-config/src/__tests__/resolveConfigPath.test.ts
```
Resolve config path .js
✅ file path with ".js"
✅ directory path with ".js"
Resolve config path .ts
✅ file path with ".ts"
✅ directory path with ".ts"
Resolve config path .mjs
✅ file path with ".mjs"
✅ directory path with ".mjs"
Resolve config path .cjs
✅ file path with ".cjs"
✅ directory path with ".cjs"
Resolve config path .json
✅ file path with ".json"
✅ directory path with ".json"
```
### ✅ packages/jest-config/src/__tests__/setFromArgv.test.ts
```
✅ maps special values to valid options
✅ maps regular values to themselves
✅ works with string objects
✅ explicit flags override those from --config
```
### ✅ packages/jest-config/src/__tests__/validatePattern.test.ts
```
validate pattern function
✅ without passed args returns true
✅ returns true for empty pattern
✅ returns true for valid pattern
✅ returns false for invalid pattern
```
### ✅ packages/jest-console/src/__tests__/bufferedConsole.test.ts
```
CustomConsole assert
✅ do not log when the assertion is truthy
✅ do not log when the assertion is truthy and there is a message
✅ log the assertion error when the assertion is falsy
✅ log the assertion error when the assertion is falsy with another message argument
CustomConsole count
✅ count using the default counter
✅ count using the a labeled counter
✅ countReset restarts default counter
✅ countReset restarts custom counter
CustomConsole group
✅ group without label
✅ group with label
✅ groupEnd remove the indentation of the current group
✅ groupEnd can not remove the indentation below the starting point
CustomConsole time
✅ should return the time between time() and timeEnd() on default timer
✅ should return the time between time() and timeEnd() on custom timer
CustomConsole dir
✅ should print the deepest value
CustomConsole timeLog
✅ should return the time between time() and timeEnd() on default timer
✅ should return the time between time() and timeEnd() on custom timer
✅ default timer with data
✅ custom timer with data
CustomConsole console
✅ should be able to initialize console instance
```
### ✅ packages/jest-console/src/__tests__/CustomConsole.test.ts
```
CustomConsole log
✅ should print to stdout
CustomConsole error
✅ should print to stderr
CustomConsole warn
✅ should print to stderr
CustomConsole assert
✅ do not log when the assertion is truthy
✅ do not log when the assertion is truthy and there is a message
✅ log the assertion error when the assertion is falsy
✅ log the assertion error when the assertion is falsy with another message argument
CustomConsole count
✅ count using the default counter
✅ count using the a labeled counter
✅ countReset restarts default counter
✅ countReset restarts custom counter
CustomConsole group
✅ group without label
✅ group with label
✅ groupEnd remove the indentation of the current group
✅ groupEnd can not remove the indentation below the starting point
CustomConsole time
✅ should return the time between time() and timeEnd() on default timer
✅ should return the time between time() and timeEnd() on custom timer
CustomConsole dir
✅ should print the deepest value
CustomConsole timeLog
✅ should return the time between time() and timeEnd() on default timer
✅ should return the time between time() and timeEnd() on custom timer
✅ default timer with data
✅ custom timer with data
CustomConsole console
✅ should be able to initialize console instance
```
### ✅ packages/jest-console/src/__tests__/getConsoleOutput.test.ts
```
getConsoleOutput
✅ takes noStackTrace and pass it on for assert
✅ takes noStackTrace and pass it on for count
✅ takes noStackTrace and pass it on for debug
✅ takes noStackTrace and pass it on for dir
✅ takes noStackTrace and pass it on for dirxml
✅ takes noStackTrace and pass it on for error
✅ takes noStackTrace and pass it on for group
✅ takes noStackTrace and pass it on for groupCollapsed
✅ takes noStackTrace and pass it on for info
✅ takes noStackTrace and pass it on for log
✅ takes noStackTrace and pass it on for time
✅ takes noStackTrace and pass it on for warn
```
### ✅ packages/jest-core/src/__tests__/FailedTestsCache.test.js
```
FailedTestsCache
✅ should filter tests
```
### ✅ packages/jest-core/src/__tests__/getNoTestsFoundMessage.test.js
```
getNoTestsFoundMessage
✅ returns correct message when monitoring only failures
✅ returns correct message when monitoring only changed
✅ returns correct message with verbose option
✅ returns correct message without options
✅ returns correct message with passWithNoTests
```
### ✅ packages/jest-core/src/__tests__/globals.test.ts
```
Common globals
✅ check process
```
### ✅ packages/jest-core/src/__tests__/runJest.test.js
```
runJest
✅ when watch is set then exit process
✅ when watch is set then an error message is printed
```
### ✅ packages/jest-core/src/__tests__/SearchSource.test.ts
```
SearchSource isTestFilePath
✅ supports ../ paths and unix separators via testRegex
✅ supports unix separators
✅ supports win32 separators
SearchSource testPathsMatching
✅ finds tests matching a pattern via testRegex
✅ finds tests matching a pattern via testMatch
✅ finds tests matching a JS regex pattern
✅ finds tests matching a JS glob pattern
✅ finds tests matching a JS with overriding glob patterns
✅ finds tests with default file extensions using testRegex
✅ finds tests with default file extensions using testMatch
✅ finds tests with parentheses in their rootDir when using testMatch
✅ finds tests with similar but custom file extensions
✅ finds tests with totally custom foobar file extensions
✅ finds tests with many kinds of file extensions
✅ finds tests using a regex only
✅ finds tests using a glob only
SearchSource findRelatedTests
✅ makes sure a file is related to itself
✅ finds tests that depend directly on the path
✅ excludes untested files from coverage
SearchSource findRelatedTestsFromPattern
✅ returns empty search result for empty input
✅ returns empty search result for invalid input
✅ returns empty search result if no related tests were found
✅ finds tests for a single file
✅ finds tests for multiple files
✅ does not mistake roots folders with prefix names
SearchSource findRelatedSourcesFromTestsInChangedFiles
✅ return empty set if no SCM
✅ return sources required by tests
```
### ✅ packages/jest-core/src/__tests__/SnapshotInteractiveMode.test.js
```
SnapshotInteractiveMode
✅ is inactive at construction
✅ call to run process the first file
✅ call to abort
✅ call to reset
✅ press Q or ESC triggers an abort
✅ press ENTER trigger a run
✅ skip 1 test, then restart
✅ skip 1 test, then quit
✅ update 1 test, then finish and return
✅ skip 2 tests, then finish and restart
✅ update 2 tests, then finish and return
✅ update 1 test, skip 1 test, then finish and restart
✅ skip 1 test, update 1 test, then finish and restart
```
### ✅ packages/jest-core/src/__tests__/TestScheduler.test.js
```
✅ config for reporters supports `default`
✅ .addReporter() .removeReporter()
✅ schedule tests run in parallel per default
✅ schedule tests run in serial if the runner flags them
✅ should bail after `n` failures
✅ should not bail if less than `n` failures
✅ should set runInBand to run in serial
✅ should set runInBand to not run in serial
```
### ✅ packages/jest-core/src/__tests__/testSchedulerHelper.test.js
```
✅ shouldRunInBand() - should return true for runInBand mode
✅ shouldRunInBand() - should return true for runInBand mode
✅ shouldRunInBand() - should return false for runInBand mode
✅ shouldRunInBand() - should return false for runInBand mode
✅ shouldRunInBand() - should return false for runInBand mode
✅ shouldRunInBand() - should return true for runInBand mode
✅ shouldRunInBand() - should return false for runInBand mode
✅ shouldRunInBand() - should return true for runInBand mode
✅ shouldRunInBand() - should return true for runInBand mode
✅ shouldRunInBand() - should return false for runInBand mode
✅ shouldRunInBand() - should return false for runInBand mode
✅ shouldRunInBand() - should return true for runInBand mode
```
### ✅ packages/jest-core/src/__tests__/watch.test.js
```
Watch mode flows
✅ Correctly passing test path pattern
✅ Correctly passing test name pattern
✅ Runs Jest once by default and shows usage
✅ Runs Jest in a non-interactive environment not showing usage
✅ resolves relative to the package root
✅ shows prompts for WatchPlugins in alphabetical order
✅ shows update snapshot prompt (without interactive)
✅ shows update snapshot prompt (with interactive)
✅ allows WatchPlugins to hook into JestHook
✅ allows WatchPlugins to override eligible internal plugins
✅ allows WatchPlugins to be configured
✅ allows WatchPlugins to hook into file system changes
✅ makes watch plugin initialization errors look nice
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ allows WatchPlugins to modify only white-listed global config keys
✅ triggers enter on a WatchPlugin when its key is pressed
✅ prevents Jest from handling keys when active and returns control when end is called
✅ Pressing "o" runs test in "only changed files" mode
✅ Pressing "a" runs test in "watch all" mode
✅ Pressing "ENTER" reruns the tests
✅ Pressing "t" reruns the tests in "test name pattern" mode
✅ Pressing "p" reruns the tests in "filename pattern" mode
✅ Can combine "p" and "t" filters
✅ Pressing "u" reruns the tests in "update snapshot" mode
✅ passWithNoTest should be set to true in watch mode
✅ shows the correct usage for the f key in "only failed tests" mode
Watch mode flows when dealing with potential watch plugin key conflicts
✅ forbids WatchPlugins overriding reserved internal plugins
✅ forbids WatchPlugins overriding reserved internal plugins
✅ forbids WatchPlugins overriding reserved internal plugins
✅ allows WatchPlugins to override non-reserved internal plugins
✅ allows WatchPlugins to override non-reserved internal plugins
✅ forbids third-party WatchPlugins overriding each other
```
### ✅ packages/jest-core/src/__tests__/watchFileChanges.test.ts
```
Watch mode flows with changed files
✅ should correct require new files without legacy cache
```
### ✅ packages/jest-core/src/__tests__/watchFilenamePatternMode.test.js
```
Watch mode flows
✅ Pressing "P" enters pattern mode
✅ Pressing "c" clears the filters
```
### ✅ packages/jest-core/src/__tests__/watchTestNamePatternMode.test.js
```
Watch mode flows
✅ Pressing "T" enters pattern mode
```
### ✅ packages/jest-core/src/lib/__tests__/isValidPath.test.ts
```
✅ is valid when it is a file inside roots
✅ is not valid when it is a snapshot file
✅ is not valid when it is a file in the coverage dir
```
### ✅ packages/jest-core/src/lib/__tests__/logDebugMessages.test.ts
```
✅ prints the jest version
✅ prints the test framework name
✅ prints the config object
```
### ✅ packages/jest-create-cache-key-function/src/__tests__/index.test.ts
```
✅ creation of a cache key
```
### ✅ packages/jest-diff/src/__tests__/diff.test.ts
```
different types
✅ '1' and 'a'
✅ '[object Object]' and 'a'
✅ '' and '2'
✅ 'null' and 'undefined'
✅ '() => {}' and '3'
no visual difference
✅ '"a"' and '"a"'
✅ '{}' and '{}'
✅ '[]' and '[]'
✅ '[1,2]' and '[1,2]'
✅ '11' and '11'
✅ 'null' and 'null'
✅ 'null' and 'null'
✅ 'undefined' and 'undefined'
✅ 'null' and 'null'
✅ 'undefined' and 'undefined'
✅ 'false' and 'false'
✅ '{"a":1}' and '{"a":1}'
✅ '{"a":{"b":5}}' and '{"a":{"b":5}}'
✅ Map key order should be irrelevant
✅ Set value order should be irrelevant
✅ oneline strings
✅ numbers
✅ -0 and 0
✅ booleans
✅ collapses big diffs to patch format
falls back to not call toJSON if serialization has no differences
✅ but then objects have differences
✅ and then objects have no differences
falls back to not call toJSON if it throws
✅ and then objects have differences
✅ and then objects have no differences
multiline strings
✅ (unexpanded)
✅ (expanded)
objects
✅ (unexpanded)
✅ (expanded)
multiline string non-snapshot
✅ (unexpanded)
✅ (expanded)
multiline string snapshot
✅ (unexpanded)
✅ (expanded)
React elements
✅ (unexpanded)
✅ (expanded)
multiline string as value of object property (non-snapshot)
✅ (unexpanded)
✅ (expanded)
multiline string as value of object property (snapshot)
✅ (unexpanded)
✅ (expanded)
indentation in JavaScript structures from less to more
✅ (unexpanded)
✅ (expanded)
indentation in JavaScript structures from more to less
✅ (unexpanded)
✅ (expanded)
color of text
✅ (expanded)
✅ (unexpanded)
indentation in React elements (non-snapshot) from less to more
✅ (unexpanded)
✅ (expanded)
indentation in React elements (non-snapshot) from more to less
✅ (unexpanded)
✅ (expanded)
indentation in React elements (snapshot) from less to more
✅ (unexpanded)
✅ (expanded)
indentation in React elements (snapshot) from more to less
✅ (unexpanded)
✅ (expanded)
outer React element (non-snapshot) from less to more
✅ (unexpanded)
✅ (expanded)
outer React element (non-snapshot) from more to less
✅ (unexpanded)
✅ (expanded)
trailing newline in multiline string not enclosed in quotes from less to more
✅ (unexpanded)
✅ (expanded)
trailing newline in multiline string not enclosed in quotes from more to less
✅ (unexpanded)
✅ (expanded)
context
✅ number of lines: -1 (5 default)
✅ number of lines: 0
✅ number of lines: 1
✅ number of lines: 2
✅ number of lines: 3.1 (5 default)
✅ number of lines: undefined (5 default)
diffLinesUnified edge cases
✅ a empty string b empty string
✅ a empty string b one line
✅ a multiple lines b empty string
✅ a one line b multiple lines
diffLinesUnified2 edge cases
✅ a empty string b empty string
✅ a empty string b one line
✅ a multiple lines b empty string
✅ a one line b multiple lines
diffLinesUnified2 edge cases lengths not equal
✅ a
✅ b
diffStringsUnified edge cases
✅ empty both a and b
✅ empty only a
✅ empty only b
✅ equal both non-empty
✅ multiline has no common after clean up chaff
✅ one-line has no common after clean up chaff
options 7980
✅ diff
✅ diffStringsUnified
options change indicators
✅ diff
options change color
✅ diffStringsUnified
✅ no diff
options common
✅ diff
✅ no diff
options includeChangeCounts false
✅ diffLinesUnified
✅ diffStringsUnified
options includeChangeCounts true padding
✅ diffLinesUnified a has 2 digits
✅ diffLinesUnified b has 2 digits
✅ diffStringsUnified
options omitAnnotationLines true
✅ diff
✅ diffStringsUnified and includeChangeCounts true
✅ diffStringsUnified empty strings
options trailingSpaceFormatter
✅ diffDefault default no color
✅ diffDefault middle dot
✅ diffDefault yellowish common
options emptyFirstOrLastLinePlaceholder default empty string
✅ diffDefault
✅ diffStringsUnified
```
### ✅ packages/jest-diff/src/__tests__/diffStringsRaw.test.ts
```
diffStringsRaw
✅ one-line with cleanup
✅ one-line without cleanup
```
### ✅ packages/jest-diff/src/__tests__/getAlignedDiffs.test.ts
```
getAlignedDiffs lines
✅ change preceding and following common
✅ common preceding and following change
✅ common at end when both current change lines are empty
✅ common between delete and insert
✅ common between insert and delete
getAlignedDiffs newline
✅ delete only
✅ insert only
✅ delete with adjacent change
✅ insert with adjacent changes
✅ change from space
✅ change to space
getAlignedDiffs substrings first
✅ common when both current change lines are empty
✅ common when either current change line is non-empty
✅ delete completes the current line
✅ insert completes the current line
getAlignedDiffs substrings middle
✅ is empty in delete between common
✅ is empty in insert at start
✅ is non-empty in delete at end
✅ is non-empty in insert between common
getAlignedDiffs substrings last
✅ is empty in delete at end
✅ is empty in insert at end
✅ is non-empty in common not at end
getAlignedDiffs strings
✅ change at start and delete or insert at end
✅ delete or insert at start and change at end
```
### ✅ packages/jest-diff/src/__tests__/joinAlignedDiffs.test.ts
```
joinAlignedDiffsExpand
✅ first line is empty common
joinAlignedDiffsNoExpand
✅ patch 0 with context 1 and change at start and end
✅ patch 0 with context 5 and first line is empty common
✅ patch 1 with context 4 and last line is empty common
✅ patch 2 with context 3
✅ patch 3 with context 2 and omit excess common at start
```
### ✅ packages/jest-docblock/src/__tests__/index.test.ts
```
docblock
✅ extracts valid docblock with line comment
✅ extracts valid docblock
✅ extracts valid docblock with more comments
✅ extracts from invalid docblock
✅ returns extract and parsedocblock
✅ parses directives out of a docblock
✅ parses multiple of the same directives out of a docblock
✅ parses >=3 of the same directives out of a docblock
✅ parses directives out of a docblock with comments
✅ parses directives out of a docblock with line comments
✅ parses multiline directives
✅ parses multiline directives even if there are linecomments within the docblock
✅ supports slashes in @team directive
✅ extracts comments from docblock
✅ extracts multiline comments from docblock
✅ preserves leading whitespace in multiline comments from docblock
✅ removes leading newlines in multiline comments from docblock
✅ extracts comments from beginning and end of docblock
✅ preserve urls within a pragma's values
✅ strip linecomments from pragmas but preserve for comments
✅ extracts docblock comments as CRLF when docblock contains CRLF
✅ extracts docblock comments as LF when docblock contains LF
✅ strips the docblock out of a file that contains a top docblock
✅ returns a file unchanged if there is no top docblock to strip
✅ prints docblocks with no pragmas as empty string
✅ prints docblocks with one pragma on one line
✅ prints docblocks with multiple pragmas on multiple lines
✅ prints docblocks with multiple of the same pragma
✅ prints docblocks with pragmas
✅ prints docblocks with comments
✅ prints docblocks with comments and no keys
✅ prints docblocks with multiline comments
✅ prints docblocks that are parseable
✅ can augment existing docblocks with comments
✅ prints docblocks using CRLF if comments contains CRLF
✅ prints docblocks using LF if comments contains LF
```
### ✅ packages/jest-each/src/__tests__/array.test.ts
```
jest-each .test
✅ throws an error when not called with an array
✅ throws an error when called with an empty array
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using printf format
✅ does not call global test with title containing more param values than sprintf placeholders
✅ calls global test title with %p placeholder injected at the correct positions
✅ does not calls global test title with %p placeholder when no data is supplied at given position
✅ calls global with cb function containing all parameters of each test case when given 1d array
✅ calls global with cb function containing all parameters of each test case 2d array
✅ calls global with given timeout
jest-each .test.concurrent
✅ throws an error when not called with an array
✅ throws an error when called with an empty array
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using printf format
✅ does not call global test with title containing more param values than sprintf placeholders
✅ calls global test title with %p placeholder injected at the correct positions
✅ does not calls global test title with %p placeholder when no data is supplied at given position
✅ calls global with cb function containing all parameters of each test case when given 1d array
✅ calls global with cb function containing all parameters of each test case 2d array
✅ calls global with given timeout
jest-each .test.concurrent.only
✅ throws an error when not called with an array
✅ throws an error when called with an empty array
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using printf format
✅ does not call global test with title containing more param values than sprintf placeholders
✅ calls global test title with %p placeholder injected at the correct positions
✅ does not calls global test title with %p placeholder when no data is supplied at given position
✅ calls global with cb function containing all parameters of each test case when given 1d array
✅ calls global with cb function containing all parameters of each test case 2d array
✅ calls global with given timeout
jest-each .test.concurrent.skip
✅ throws an error when not called with an array
✅ throws an error when called with an empty array
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using printf format
✅ does not call global test with title containing more param values than sprintf placeholders
✅ calls global test title with %p placeholder injected at the correct positions
✅ does not calls global test title with %p placeholder when no data is supplied at given position
✅ calls global with cb function containing all parameters of each test case when given 1d array
✅ calls global with cb function containing all parameters of each test case 2d array
✅ calls global with given timeout
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using sprintf format
✅ calls global with title with placeholder values correctly interpolated
jest-each .test.only
✅ throws an error when not called with an array
✅ throws an error when called with an empty array
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using printf format
✅ does not call global test with title containing more param values than sprintf placeholders
✅ calls global test title with %p placeholder injected at the correct positions
✅ does not calls global test title with %p placeholder when no data is supplied at given position
✅ calls global with cb function containing all parameters of each test case when given 1d array
✅ calls global with cb function containing all parameters of each test case 2d array
✅ calls global with given timeout
jest-each .it
✅ throws an error when not called with an array
✅ throws an error when called with an empty array
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using printf format
✅ does not call global test with title containing more param values than sprintf placeholders
✅ calls global test title with %p placeholder injected at the correct positions
✅ does not calls global test title with %p placeholder when no data is supplied at given position
✅ calls global with cb function containing all parameters of each test case when given 1d array
✅ calls global with cb function containing all parameters of each test case 2d array
✅ calls global with given timeout
jest-each .fit
✅ throws an error when not called with an array
✅ throws an error when called with an empty array
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using printf format
✅ does not call global test with title containing more param values than sprintf placeholders
✅ calls global test title with %p placeholder injected at the correct positions
✅ does not calls global test title with %p placeholder when no data is supplied at given position
✅ calls global with cb function containing all parameters of each test case when given 1d array
✅ calls global with cb function containing all parameters of each test case 2d array
✅ calls global with given timeout
jest-each .it.only
✅ throws an error when not called with an array
✅ throws an error when called with an empty array
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using printf format
✅ does not call global test with title containing more param values than sprintf placeholders
✅ calls global test title with %p placeholder injected at the correct positions
✅ does not calls global test title with %p placeholder when no data is supplied at given position
✅ calls global with cb function containing all parameters of each test case when given 1d array
✅ calls global with cb function containing all parameters of each test case 2d array
✅ calls global with given timeout
jest-each .describe
✅ throws an error when not called with an array
✅ throws an error when called with an empty array
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using printf format
✅ does not call global test with title containing more param values than sprintf placeholders
✅ calls global test title with %p placeholder injected at the correct positions
✅ does not calls global test title with %p placeholder when no data is supplied at given position
✅ calls global with cb function containing all parameters of each test case when given 1d array
✅ calls global with cb function containing all parameters of each test case 2d array
✅ calls global with given timeout
jest-each .fdescribe
✅ throws an error when not called with an array
✅ throws an error when called with an empty array
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using printf format
✅ does not call global test with title containing more param values than sprintf placeholders
✅ calls global test title with %p placeholder injected at the correct positions
✅ does not calls global test title with %p placeholder when no data is supplied at given position
✅ calls global with cb function containing all parameters of each test case when given 1d array
✅ calls global with cb function containing all parameters of each test case 2d array
✅ calls global with given timeout
jest-each .describe.only
✅ throws an error when not called with an array
✅ throws an error when called with an empty array
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using printf format
✅ does not call global test with title containing more param values than sprintf placeholders
✅ calls global test title with %p placeholder injected at the correct positions
✅ does not calls global test title with %p placeholder when no data is supplied at given position
✅ calls global with cb function containing all parameters of each test case when given 1d array
✅ calls global with cb function containing all parameters of each test case 2d array
✅ calls global with given timeout
jest-each done callback
✅ calls [ 'test' ] with done when cb function has more args than params of given test row
✅ calls [ 'test', 'only' ] with done when cb function has more args than params of given test row
✅ calls [ 'test', 'concurrent' ] with done when cb function has more args than params of given test row
✅ calls [ 'test', 'concurrent', 'only' ] with done when cb function has more args than params of given test row
✅ calls [ 'it' ] with done when cb function has more args than params of given test row
✅ calls [ 'fit' ] with done when cb function has more args than params of given test row
✅ calls [ 'it', 'only' ] with done when cb function has more args than params of given test row
✅ does not call [ 'describe' ] with done when test function has more args than params of given test row
✅ does not call [ 'fdescribe' ] with done when test function has more args than params of given test row
✅ does not call [ 'describe', 'only' ] with done when test function has more args than params of given test row
jest-each .xtest
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using sprintf format
✅ calls global with title with placeholder values correctly interpolated
jest-each .test.skip
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using sprintf format
✅ calls global with title with placeholder values correctly interpolated
jest-each .xit
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using sprintf format
✅ calls global with title with placeholder values correctly interpolated
jest-each .it.skip
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using sprintf format
✅ calls global with title with placeholder values correctly interpolated
jest-each .xdescribe
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using sprintf format
✅ calls global with title with placeholder values correctly interpolated
jest-each .describe.skip
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using sprintf format
✅ calls global with title with placeholder values correctly interpolated
```
### ✅ packages/jest-each/src/__tests__/index.test.ts
```
array .add
✅ returns the result of adding 0 to 0
✅ returns the result of adding 0 to 1
✅ returns the result of adding 1 to 1
concurrent .add
✅ returns the result of adding 0 to 0
✅ returns the result of adding 0 to 1
✅ returns the result of adding 1 to 1
template .add
✅ returns 0 when given 0 and 0
✅ returns 1 when given 0 and 1
✅ returns 2 when given 1 and 1
✅ throws an error when not called with the right number of arguments
```
### ✅ packages/jest-each/src/__tests__/template.test.ts
```
jest-each .test
✅ throws error when there are additional words in first column heading
✅ throws error when there are additional words in second column heading
✅ throws error when there are additional words in last column heading
✅ does not throw error when there is additional words in template after heading row
✅ does not throw error when there is only one column
✅ does not throw error when there is only one column with additional words in template after heading
✅ throws error when there are no arguments for given headings
✅ throws error when there are fewer arguments than headings when given one row
✅ throws error when there are fewer arguments than headings over multiple rows
✅ throws an error when called with an empty string
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
✅ calls global with title containing $key in multiple positions
✅ calls global with title containing $key.path
✅ calls global with title containing last seen object when $key.path is invalid
✅ calls global with cb function with object built from table headings and values
✅ calls global with given timeout
✅ formats primitive values using .toString()
jest-each .test.concurrent
✅ throws error when there are additional words in first column heading
✅ throws error when there are additional words in second column heading
✅ throws error when there are additional words in last column heading
✅ does not throw error when there is additional words in template after heading row
✅ does not throw error when there is only one column
✅ does not throw error when there is only one column with additional words in template after heading
✅ throws error when there are no arguments for given headings
✅ throws error when there are fewer arguments than headings when given one row
✅ throws error when there are fewer arguments than headings over multiple rows
✅ throws an error when called with an empty string
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
✅ calls global with title containing $key in multiple positions
✅ calls global with title containing $key.path
✅ calls global with title containing last seen object when $key.path is invalid
✅ calls global with cb function with object built from table headings and values
✅ calls global with given timeout
✅ formats primitive values using .toString()
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
jest-each .test.concurrent.only
✅ throws error when there are additional words in first column heading
✅ throws error when there are additional words in second column heading
✅ throws error when there are additional words in last column heading
✅ does not throw error when there is additional words in template after heading row
✅ does not throw error when there is only one column
✅ does not throw error when there is only one column with additional words in template after heading
✅ throws error when there are no arguments for given headings
✅ throws error when there are fewer arguments than headings when given one row
✅ throws error when there are fewer arguments than headings over multiple rows
✅ throws an error when called with an empty string
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
✅ calls global with title containing $key in multiple positions
✅ calls global with title containing $key.path
✅ calls global with title containing last seen object when $key.path is invalid
✅ calls global with cb function with object built from table headings and values
✅ calls global with given timeout
✅ formats primitive values using .toString()
jest-each .test.concurrent.skip
✅ throws error when there are additional words in first column heading
✅ throws error when there are additional words in second column heading
✅ throws error when there are additional words in last column heading
✅ does not throw error when there is additional words in template after heading row
✅ does not throw error when there is only one column
✅ does not throw error when there is only one column with additional words in template after heading
✅ throws error when there are no arguments for given headings
✅ throws error when there are fewer arguments than headings when given one row
✅ throws error when there are fewer arguments than headings over multiple rows
✅ throws an error when called with an empty string
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
✅ calls global with title containing $key in multiple positions
✅ calls global with title containing $key.path
✅ calls global with title containing last seen object when $key.path is invalid
✅ calls global with cb function with object built from table headings and values
✅ calls global with given timeout
✅ formats primitive values using .toString()
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
jest-each .test.only
✅ throws error when there are additional words in first column heading
✅ throws error when there are additional words in second column heading
✅ throws error when there are additional words in last column heading
✅ does not throw error when there is additional words in template after heading row
✅ does not throw error when there is only one column
✅ does not throw error when there is only one column with additional words in template after heading
✅ throws error when there are no arguments for given headings
✅ throws error when there are fewer arguments than headings when given one row
✅ throws error when there are fewer arguments than headings over multiple rows
✅ throws an error when called with an empty string
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
✅ calls global with title containing $key in multiple positions
✅ calls global with title containing $key.path
✅ calls global with title containing last seen object when $key.path is invalid
✅ calls global with cb function with object built from table headings and values
✅ calls global with given timeout
✅ formats primitive values using .toString()
jest-each .it
✅ throws error when there are additional words in first column heading
✅ throws error when there are additional words in second column heading
✅ throws error when there are additional words in last column heading
✅ does not throw error when there is additional words in template after heading row
✅ does not throw error when there is only one column
✅ does not throw error when there is only one column with additional words in template after heading
✅ throws error when there are no arguments for given headings
✅ throws error when there are fewer arguments than headings when given one row
✅ throws error when there are fewer arguments than headings over multiple rows
✅ throws an error when called with an empty string
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
✅ calls global with title containing $key in multiple positions
✅ calls global with title containing $key.path
✅ calls global with title containing last seen object when $key.path is invalid
✅ calls global with cb function with object built from table headings and values
✅ calls global with given timeout
✅ formats primitive values using .toString()
jest-each .fit
✅ throws error when there are additional words in first column heading
✅ throws error when there are additional words in second column heading
✅ throws error when there are additional words in last column heading
✅ does not throw error when there is additional words in template after heading row
✅ does not throw error when there is only one column
✅ does not throw error when there is only one column with additional words in template after heading
✅ throws error when there are no arguments for given headings
✅ throws error when there are fewer arguments than headings when given one row
✅ throws error when there are fewer arguments than headings over multiple rows
✅ throws an error when called with an empty string
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
✅ calls global with title containing $key in multiple positions
✅ calls global with title containing $key.path
✅ calls global with title containing last seen object when $key.path is invalid
✅ calls global with cb function with object built from table headings and values
✅ calls global with given timeout
✅ formats primitive values using .toString()
jest-each .it.only
✅ throws error when there are additional words in first column heading
✅ throws error when there are additional words in second column heading
✅ throws error when there are additional words in last column heading
✅ does not throw error when there is additional words in template after heading row
✅ does not throw error when there is only one column
✅ does not throw error when there is only one column with additional words in template after heading
✅ throws error when there are no arguments for given headings
✅ throws error when there are fewer arguments than headings when given one row
✅ throws error when there are fewer arguments than headings over multiple rows
✅ throws an error when called with an empty string
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
✅ calls global with title containing $key in multiple positions
✅ calls global with title containing $key.path
✅ calls global with title containing last seen object when $key.path is invalid
✅ calls global with cb function with object built from table headings and values
✅ calls global with given timeout
✅ formats primitive values using .toString()
jest-each .describe
✅ throws error when there are additional words in first column heading
✅ throws error when there are additional words in second column heading
✅ throws error when there are additional words in last column heading
✅ does not throw error when there is additional words in template after heading row
✅ does not throw error when there is only one column
✅ does not throw error when there is only one column with additional words in template after heading
✅ throws error when there are no arguments for given headings
✅ throws error when there are fewer arguments than headings when given one row
✅ throws error when there are fewer arguments than headings over multiple rows
✅ throws an error when called with an empty string
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
✅ calls global with title containing $key in multiple positions
✅ calls global with title containing $key.path
✅ calls global with title containing last seen object when $key.path is invalid
✅ calls global with cb function with object built from table headings and values
✅ calls global with given timeout
✅ formats primitive values using .toString()
jest-each .fdescribe
✅ throws error when there are additional words in first column heading
✅ throws error when there are additional words in second column heading
✅ throws error when there are additional words in last column heading
✅ does not throw error when there is additional words in template after heading row
✅ does not throw error when there is only one column
✅ does not throw error when there is only one column with additional words in template after heading
✅ throws error when there are no arguments for given headings
✅ throws error when there are fewer arguments than headings when given one row
✅ throws error when there are fewer arguments than headings over multiple rows
✅ throws an error when called with an empty string
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
✅ calls global with title containing $key in multiple positions
✅ calls global with title containing $key.path
✅ calls global with title containing last seen object when $key.path is invalid
✅ calls global with cb function with object built from table headings and values
✅ calls global with given timeout
✅ formats primitive values using .toString()
jest-each .describe.only
✅ throws error when there are additional words in first column heading
✅ throws error when there are additional words in second column heading
✅ throws error when there are additional words in last column heading
✅ does not throw error when there is additional words in template after heading row
✅ does not throw error when there is only one column
✅ does not throw error when there is only one column with additional words in template after heading
✅ throws error when there are no arguments for given headings
✅ throws error when there are fewer arguments than headings when given one row
✅ throws error when there are fewer arguments than headings over multiple rows
✅ throws an error when called with an empty string
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
✅ calls global with title containing $key in multiple positions
✅ calls global with title containing $key.path
✅ calls global with title containing last seen object when $key.path is invalid
✅ calls global with cb function with object built from table headings and values
✅ calls global with given timeout
✅ formats primitive values using .toString()
jest-each done callback
✅ calls [ 'test' ] with done when cb function has more args than params of given test row
✅ calls [ 'test', 'only' ] with done when cb function has more args than params of given test row
✅ calls [ 'test', 'concurrent', 'only' ] with done when cb function has more args than params of given test row
✅ calls [ 'it' ] with done when cb function has more args than params of given test row
✅ calls [ 'fit' ] with done when cb function has more args than params of given test row
✅ calls [ 'it', 'only' ] with done when cb function has more args than params of given test row
✅ does not call [ 'describe' ] with done when test function has more args than params of given test row
✅ does not call [ 'fdescribe' ] with done when test function has more args than params of given test row
✅ does not call [ 'describe', 'only' ] with done when test function has more args than params of given test row
jest-each .xtest
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
jest-each .test.skip
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
jest-each .xit
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
jest-each .it.skip
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
jest-each .xdescribe
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
jest-each .describe.skip
✅ calls global with given title
✅ calls global with given title when multiple tests cases exist
✅ calls global with title containing param values when using $variable format
```
### ✅ packages/jest-environment-jsdom/src/__tests__/jsdom_environment.test.ts
```
JSDomEnvironment
✅ should configure setTimeout/setInterval to use the browser api
✅ has modern fake timers implementation
```
### ✅ packages/jest-environment-node/src/__tests__/node_environment.test.ts
```
NodeEnvironment
✅ uses a copy of the process object
✅ exposes process.on
✅ exposes global.global
✅ should configure setTimeout/setInterval to use the node api
✅ has modern fake timers implementation
✅ TextEncoder references the same global Uint8Array constructor
```
### ✅ packages/jest-fake-timers/src/__tests__/legacyFakeTimers.test.ts
```
FakeTimers construction
✅ installs setTimeout mock
✅ accepts to promisify setTimeout mock
✅ installs clearTimeout mock
✅ installs setInterval mock
✅ installs clearInterval mock
✅ mocks process.nextTick if it exists on global
✅ mocks setImmediate if it exists on global
✅ mocks clearImmediate if setImmediate is on global
FakeTimers runAllTicks
✅ runs all ticks, in order
✅ does nothing when no ticks have been scheduled
✅ only runs a scheduled callback once
✅ cancels a callback even from native nextTick
✅ cancels a callback even from native setImmediate
✅ doesnt run a tick callback if native nextTick already did
✅ doesnt run immediate if native setImmediate already did
✅ native doesnt run immediate if fake already did
✅ throws before allowing infinite recursion
FakeTimers runAllTimers
✅ runs all timers in order
✅ warns when trying to advance timers while real timers are used
✅ does nothing when no timers have been scheduled
✅ only runs a setTimeout callback once (ever)
✅ runs callbacks with arguments after the interval
✅ doesnt pass the callback to native setTimeout
✅ throws before allowing infinite recursion
✅ also clears ticks
FakeTimers advanceTimersByTime
✅ runs timers in order
✅ does nothing when no timers have been scheduled
✅ throws before allowing infinite recursion
FakeTimers advanceTimersToNextTimer
✅ runs timers in order
✅ run correct amount of steps
✅ setTimeout inside setTimeout
✅ does nothing when no timers have been scheduled
FakeTimers reset
✅ resets all pending setTimeouts
✅ resets all pending setIntervals
✅ resets all pending ticks callbacks & immediates
✅ resets current advanceTimersByTime time cursor
FakeTimers runOnlyPendingTimers
✅ runs all timers in order
✅ does not run timers that were cleared in another timer
FakeTimers runWithRealTimers
✅ executes callback with native timers
✅ resets mock timers after executing callback
✅ resets mock timer functions even if callback throws
FakeTimers useRealTimers
✅ resets native timer APIs
✅ resets native process.nextTick when present
✅ resets native setImmediate when present
FakeTimers useFakeTimers
✅ resets mock timer APIs
✅ resets mock process.nextTick when present
✅ resets mock setImmediate when present
FakeTimers getTimerCount
✅ returns the correct count
✅ includes immediates and ticks
✅ not includes cancelled immediates
```
### ✅ packages/jest-fake-timers/src/__tests__/modernFakeTimers.test.ts
```
FakeTimers construction
✅ installs setTimeout mock
✅ installs clearTimeout mock
✅ installs setInterval mock
✅ installs clearInterval mock
✅ mocks process.nextTick if it exists on global
✅ mocks setImmediate if it exists on global
✅ mocks clearImmediate if setImmediate is on global
FakeTimers runAllTicks
✅ runs all ticks, in order
✅ does nothing when no ticks have been scheduled
✅ only runs a scheduled callback once
✅ throws before allowing infinite recursion
FakeTimers runAllTimers
✅ runs all timers in order
✅ warns when trying to advance timers while real timers are used
✅ does nothing when no timers have been scheduled
✅ only runs a setTimeout callback once (ever)
✅ runs callbacks with arguments after the interval
✅ doesn't pass the callback to native setTimeout
✅ throws before allowing infinite recursion
✅ also clears ticks
FakeTimers advanceTimersByTime
✅ runs timers in order
✅ does nothing when no timers have been scheduled
FakeTimers advanceTimersToNextTimer
✅ runs timers in order
✅ run correct amount of steps
✅ setTimeout inside setTimeout
✅ does nothing when no timers have been scheduled
FakeTimers reset
✅ resets all pending setTimeouts
✅ resets all pending setIntervals
✅ resets all pending ticks callbacks
✅ resets current advanceTimersByTime time cursor
FakeTimers runOnlyPendingTimers
✅ runs all timers in order
✅ does not run timers that were cleared in another timer
FakeTimers useRealTimers
✅ resets native timer APIs
✅ resets native process.nextTick when present
✅ resets native setImmediate when present
FakeTimers useFakeTimers
✅ resets mock timer APIs
✅ resets mock process.nextTick when present
✅ resets mock setImmediate when present
FakeTimers getTimerCount
✅ returns the correct count
✅ includes immediates and ticks
✅ not includes cancelled immediates
```
### ✅ packages/jest-get-type/src/__tests__/getType.test.ts
```
.getType()
✅ null
✅ undefined
✅ object
✅ array
✅ number
✅ string
✅ function
✅ boolean
✅ symbol
✅ regexp
✅ map
✅ set
✅ date
✅ bigint
```
### ✅ packages/jest-get-type/src/__tests__/isPrimitive.test.ts
```
.isPrimitive()
✅ returns true when given primitive value of: null
✅ returns true when given primitive value of: undefined
✅ returns true when given primitive value of: 100
✅ returns true when given primitive value of: hello world
✅ returns true when given primitive value of: true
✅ returns true when given primitive value of: Symbol(a)
✅ returns true when given primitive value of: 0
✅ returns true when given primitive value of: NaN
✅ returns true when given primitive value of: Infinity
✅ returns true when given primitive value of: 1n
✅ returns false when given non primitive value of: {}
✅ returns false when given non primitive value of: []
✅ returns false when given non primitive value of: undefined
✅ returns false when given non primitive value of: {}
✅ returns false when given non primitive value of: {}
✅ returns false when given non primitive value of: {}
✅ returns false when given non primitive value of: "2021-01-24T19:22:19.272Z"
✅ returns false when given non primitive value of: {}
```
### ✅ packages/jest-globals/src/__tests__/index.ts
```
✅ throw when directly imported
```
### ✅ packages/jest-haste-map/src/__tests__/get_mock_name.test.js
```
getMockName
✅ extracts mock name from file path
```
### ✅ packages/jest-haste-map/src/__tests__/includes_dotfiles.test.ts
```
✅ watchman crawler and node crawler both include dotfiles
```
### ✅ packages/jest-haste-map/src/__tests__/index.test.js
```
HasteMap
✅ exports constants
✅ creates valid cache file paths
✅ creates different cache file paths for different roots
✅ creates different cache file paths for different dependency extractor cache keys
✅ creates different cache file paths for different hasteImplModulePath cache keys
✅ creates different cache file paths for different projects
✅ matches files against a pattern
✅ ignores files given a pattern
✅ ignores vcs directories without ignore pattern
✅ ignores vcs directories with ignore pattern regex
✅ warn on ignore pattern except for regex
✅ builds a haste map on a fresh cache
✅ does not crawl native files even if requested to do so
✅ retains all files if `retainAllFiles` is specified
✅ warns on duplicate mock files
✅ warns on duplicate module ids
✅ warns on duplicate module ids only once
✅ throws on duplicate module ids if "throwOnModuleCollision" is set to true
✅ splits up modules by platform
✅ does not access the file system on a warm cache with no changes
✅ only does minimal file system access when files change
✅ correctly handles file deletions
✅ correctly handles platform-specific file additions
✅ correctly handles platform-specific file deletions
✅ correctly handles platform-specific file renames
✅ discards the cache when configuration changes
✅ ignores files that do not exist
✅ distributes work across workers
✅ tries to crawl using node as a fallback
✅ tries to crawl using node as a fallback when promise fails once
✅ stops crawling when both crawlers fail
HasteMap builds a haste map on a fresh cache with SHA-1s
✅ uses watchman: false
✅ uses watchman: true
HasteMap duplicate modules
✅ recovers when a duplicate file is deleted
✅ recovers with the correct type when a duplicate file is deleted
✅ recovers when a duplicate module is renamed
HasteMap file system changes processing
✅ provides a new set of hasteHS and moduleMap
✅ handles several change events at once
✅ does not emit duplicate change events
✅ emits a change even if a file in node_modules has changed
✅ correctly tracks changes to both platform-specific versions of a single module name
HasteMap file system changes processing recovery from duplicate module IDs
✅ recovers when the oldest version of the duplicates is fixed
✅ recovers when the most recent duplicate is fixed
✅ ignore directories
```
### ✅ packages/jest-haste-map/src/__tests__/worker.test.js
```
worker
✅ parses JavaScript files and extracts module information
✅ accepts a custom dependency extractor
✅ delegates to hasteImplModulePath for getting the id
✅ parses package.json files as haste packages
✅ returns an error when a file cannot be accessed
✅ simply computes SHA-1s when requested (works well with binary data)
✅ avoids computing dependencies if not requested and Haste does not need it
```
### ✅ packages/jest-haste-map/src/crawlers/__tests__/node.test.js
```
node crawler
✅ crawls for files based on patterns
✅ updates only changed files
✅ returns removed files
✅ uses node fs APIs with incompatible find binary
✅ uses node fs APIs without find binary
✅ uses node fs APIs if "forceNodeFilesystemAPI" is set to true, regardless of platform
✅ completes with empty roots
✅ completes with fs.readdir throwing an error
node crawler readdir withFileTypes support
✅ calls lstat for directories and symlinks if readdir withFileTypes is not supported
✅ avoids calling lstat for directories and symlinks if readdir withFileTypes is supported
```
### ✅ packages/jest-haste-map/src/crawlers/__tests__/watchman.test.js
```
watchman watch
✅ returns a list of all files when there are no clocks
✅ updates file map and removedFiles when the clock is given
✅ resets the file map and tracks removedFiles when watchman is fresh
✅ properly resets the file map when only one watcher is reset
✅ does not add directory filters to query when watching a ROOT
✅ SHA-1 requested and available
✅ SHA-1 requested and NOT available
✅ source control query
```
### ✅ packages/jest-haste-map/src/lib/__tests__/dependencyExtractor.test.js
```
dependencyExtractor
✅ should not extract dependencies inside comments
✅ should not extract dependencies inside comments (windows line endings)
✅ should not extract dependencies inside comments (unicode line endings)
✅ should extract dependencies from `import` statements
✅ should extract dependencies from side-effect only `import` statements
✅ should not extract dependencies from `import type/typeof` statements
✅ should extract dependencies from `export` statements
✅ should extract dependencies from `export-from` statements
✅ should not extract dependencies from `export type/typeof` statements
✅ should extract dependencies from dynamic `import` calls
✅ should extract dependencies from `require` calls
✅ should extract dependencies from `jest.requireActual` calls
✅ should extract dependencies from `jest.requireMock` calls
✅ should extract dependencies from `jest.genMockFromModule` calls
✅ should extract dependencies from `jest.createMockFromModule` calls
```
### ✅ packages/jest-haste-map/src/lib/__tests__/fast_path.test.js
```
fastPath.relative
✅ should get relative paths inside the root
✅ should get relative paths outside the root
✅ should get relative paths outside the root when start with same word
fastPath.resolve
✅ should get the absolute path for paths inside the root
✅ should get the absolute path for paths outside the root
```
### ✅ packages/jest-haste-map/src/lib/__tests__/getPlatformExtension.test.js
```
getPlatformExtension
✅ should get platform ext
```
### ✅ packages/jest-haste-map/src/lib/__tests__/isRegExpSupported.test.js
```
isRegExpSupported
✅ should return true when passing valid regular expression
✅ should return false when passing an invalid regular expression
```
### ✅ packages/jest-haste-map/src/lib/__tests__/normalizePathSep.test.js
```
normalizePathSep
✅ does nothing on posix
✅ replace slashes on windows
```
### ✅ packages/jest-jasmine2/src/__tests__/concurrent.test.ts
```
concurrent
✅ should add 1 to number
✅ should add 1 to number
✅ should add 1 to number
```
### ✅ packages/jest-jasmine2/src/__tests__/expectationResultFactory.test.ts
```
expectationResultFactory
✅ returns the result if passed.
✅ returns the result if failed.
✅ returns the result if failed (with `message`).
✅ returns the result if failed (with `error`).
✅ returns the error name if the error message is empty
✅ returns the result if failed (with `error` as a string).
✅ returns the result if failed (with `error.stack` not as a string).
```
### ✅ packages/jest-jasmine2/src/__tests__/hooksError.test.ts
```
beforeEach hooks error throwing
✅ beforeEach throws an error when "String" is provided as a first argument to it
✅ beforeEach throws an error when 1 is provided as a first argument to it
✅ beforeEach throws an error when [] is provided as a first argument to it
✅ beforeEach throws an error when {} is provided as a first argument to it
✅ beforeEach throws an error when Symbol(hello) is provided as a first argument to it
✅ beforeEach throws an error when true is provided as a first argument to it
✅ beforeEach throws an error when null is provided as a first argument to it
✅ beforeEach throws an error when undefined is provided as a first argument to it
beforeAll hooks error throwing
✅ beforeAll throws an error when "String" is provided as a first argument to it
✅ beforeAll throws an error when 1 is provided as a first argument to it
✅ beforeAll throws an error when [] is provided as a first argument to it
✅ beforeAll throws an error when {} is provided as a first argument to it
✅ beforeAll throws an error when Symbol(hello) is provided as a first argument to it
✅ beforeAll throws an error when true is provided as a first argument to it
✅ beforeAll throws an error when null is provided as a first argument to it
✅ beforeAll throws an error when undefined is provided as a first argument to it
afterEach hooks error throwing
✅ afterEach throws an error when "String" is provided as a first argument to it
✅ afterEach throws an error when 1 is provided as a first argument to it
✅ afterEach throws an error when [] is provided as a first argument to it
✅ afterEach throws an error when {} is provided as a first argument to it
✅ afterEach throws an error when Symbol(hello) is provided as a first argument to it
✅ afterEach throws an error when true is provided as a first argument to it
✅ afterEach throws an error when null is provided as a first argument to it
✅ afterEach throws an error when undefined is provided as a first argument to it
afterAll hooks error throwing
✅ afterAll throws an error when "String" is provided as a first argument to it
✅ afterAll throws an error when 1 is provided as a first argument to it
✅ afterAll throws an error when [] is provided as a first argument to it
✅ afterAll throws an error when {} is provided as a first argument to it
✅ afterAll throws an error when Symbol(hello) is provided as a first argument to it
✅ afterAll throws an error when true is provided as a first argument to it
✅ afterAll throws an error when null is provided as a first argument to it
✅ afterAll throws an error when undefined is provided as a first argument to it
```
### ✅ packages/jest-jasmine2/src/__tests__/iterators.test.ts
```
iterators
✅ works for arrays
✅ works for custom iterables
✅ works for Sets
✅ works for Maps
```
### ✅ packages/jest-jasmine2/src/__tests__/itTestError.test.ts
```
test/it error throwing
✅ it throws error with missing callback function
✅ it throws an error when first argument isn't a string
✅ it throws an error when callback function is not a function
✅ test throws error with missing callback function
✅ test throws an error when first argument isn't a string
✅ test throws an error when callback function is not a function
```
### ✅ packages/jest-jasmine2/src/__tests__/itToTestAlias.test.ts
```
✅ global.test
```
### ✅ packages/jest-jasmine2/src/__tests__/pTimeout.test.ts
```
pTimeout
✅ calls `clearTimeout` and resolves when `promise` resolves.
✅ calls `clearTimeout` and rejects when `promise` rejects.
✅ calls `onTimeout` on timeout.
```
### ✅ packages/jest-jasmine2/src/__tests__/queueRunner.test.ts
```
queueRunner
✅ runs every function in the queue.
✅ exposes `fail` to `next`.
✅ passes errors to `onException`.
✅ passes an error to `onException` on timeout.
✅ calls `fail` with arguments
✅ calls `fail` when done(error) is invoked
```
### ✅ packages/jest-jasmine2/src/__tests__/reporter.test.ts
```
Jasmine2Reporter
✅ reports nested suites
```
### ✅ packages/jest-jasmine2/src/__tests__/Suite.test.ts
```
Suite
✅ doesn't throw on addExpectationResult when there are no children
```
### ✅ packages/jest-jasmine2/src/__tests__/todoError.test.ts
```
test/it.todo error throwing
✅ it throws error when given no arguments
✅ it throws error when given more than one argument
✅ it throws error when given none string description
```
### ✅ packages/jest-leak-detector/src/__tests__/index.test.ts
```
✅ complains if the value is a primitive
✅ does not show the GC if hidden
✅ does not hide the GC if visible
✅ correctly checks simple leaks
✅ tests different objects
✅ correctly checks more complex leaks
```
### ✅ packages/jest-matcher-utils/src/__tests__/deepCyclicCopyReplaceable.test.ts
```
✅ returns the same value for primitive or function values
✅ convert accessor descriptor into value descriptor
✅ shuold not skips non-enumerables
✅ copies symbols
✅ copies arrays as array objects
✅ handles cyclic dependencies
✅ Copy Map
✅ Copy cyclic Map
✅ return same value for built-in object type except array, map and object
✅ should copy object symbol key property
✅ should set writable, configurable to true
```
### ✅ packages/jest-matcher-utils/src/__tests__/deepCyclicCopyReplaceableDom.test.ts
```
✅ should copy dom element
✅ should copy complex element
```
### ✅ packages/jest-matcher-utils/src/__tests__/index.test.ts
```
stringify()
✅ []
✅ {}
✅ 1
✅ 0
✅ 1.5
✅ null
✅ undefined
✅ "abc"
✅ Symbol(abc)
✅ NaN
✅ Infinity
✅ -Infinity
✅ /ab\.c/gi
✅ 1n
✅ 0n
✅ circular references
✅ toJSON error
✅ toJSON errors when comparing two objects
✅ reduces maxDepth if stringifying very large objects
ensureNumbers()
✅ dont throw error when variables are numbers
✅ throws error when expected is not a number (backward compatibility)
✅ throws error when received is not a number (backward compatibility)
ensureNumbers() with options
✅ promise empty isNot false received
✅ promise empty isNot true expected
✅ promise rejects isNot false expected
✅ promise rejects isNot true received
✅ promise resolves isNot false received
✅ promise resolves isNot true expected
ensureNoExpected()
✅ dont throw error when undefined
✅ throws error when expected is not undefined with matcherName
✅ throws error when expected is not undefined with matcherName and options
diff
✅ forwards to jest-diff
✅ two booleans
✅ two numbers
✅ two bigints
pluralize()
✅ one
✅ two
✅ 20
getLabelPrinter
✅ 0 args
✅ 1 empty string
✅ 1 non-empty string
✅ 2 equal lengths
✅ 2 unequal lengths
✅ returns incorrect padding if inconsistent arg is shorter
✅ throws if inconsistent arg is longer
matcherHint
✅ expectedColor
✅ receivedColor
✅ secondArgumentColor
```
### ✅ packages/jest-matcher-utils/src/__tests__/printDiffOrStringify.test.ts
```
printDiffOrStringify
✅ expected is empty and received is single line
✅ expected is multi line and received is empty
✅ expected and received are single line with multiple changes
✅ expected and received are multi line with trailing spaces
✅ has no common after clean up chaff multiline
✅ has no common after clean up chaff one-line
✅ object contain readonly symbol key object
printDiffOrStringify MAX_DIFF_STRING_LENGTH
✅ both are less
✅ expected is more
✅ received is more
printDiffOrStringify asymmetricMatcher
✅ minimal test
✅ jest asymmetricMatcher
✅ custom asymmetricMatcher
✅ nested object
✅ array
✅ object in array
✅ map
✅ circular object
✅ transitive circular
✅ circular array
✅ circular map
```
### ✅ packages/jest-matcher-utils/src/__tests__/Replaceable.test.ts
```
Replaceable constructor
✅ init with object
✅ init with array
✅ init with Map
✅ init with other type should throw error
Replaceable get
✅ get object item
✅ get array item
✅ get Map item
Replaceable set
✅ set object item
✅ set array item
✅ set Map item
Replaceable forEach
✅ object forEach
✅ array forEach
✅ map forEach
✅ forEach should ignore nonenumerable property
Replaceable isReplaceable
✅ should return true if two object types equal and support
✅ should return false if two object types not equal
✅ should return false if object types not support
```
### ✅ packages/jest-message-util/src/__tests__/messages.test.ts
```
✅ should exclude jasmine from stack trace for Unix paths.
✅ .formatExecError()
✅ formatStackTrace should strip node internals
✅ should not exclude vendor from stack trace
✅ retains message in babel code frame error
✅ codeframe
✅ no codeframe
✅ no stack
formatStackTrace
✅ prints code frame and stacktrace
✅ does not print code frame when noCodeFrame = true
✅ does not print codeframe when noStackTrace = true
```
### ✅ packages/jest-mock/src/__tests__/index.test.ts
```
moduleMocker getMetadata
✅ returns the function `name` property
✅ mocks constant values
✅ does not retrieve metadata for arrays
✅ does not retrieve metadata for undefined
✅ does not retrieve metadata for null
✅ retrieves metadata for ES6 classes
✅ retrieves synchronous function metadata
✅ retrieves asynchronous function metadata
✅ retrieves metadata for object literals and it's members
✅ retrieves Date object metadata
moduleMocker generateFromMetadata
✅ forwards the function name property
✅ fixes illegal function name properties
✅ special cases the mockConstructor name
✅ wont interfere with previous mocks on a shared prototype
✅ does not mock non-enumerable getters
✅ mocks getters of ES modules
✅ mocks ES2015 non-enumerable methods
✅ mocks ES2015 non-enumerable static properties and methods
✅ mocks methods in all the prototype chain (null prototype)
✅ does not mock methods from Object.prototype
✅ does not mock methods from Object.prototype (in mock context)
✅ does not mock methods from Function.prototype
✅ does not mock methods from Function.prototype (in mock context)
✅ does not mock methods from RegExp.prototype
✅ does not mock methods from RegExp.prototype (in mock context)
✅ mocks methods that are bound multiple times
✅ mocks methods that are bound after mocking
✅ mocks regexp instances
✅ mocks functions with numeric names
✅ mocks the method in the passed object itself
✅ should delete previously inexistent methods when restoring
✅ supports mock value returning undefined
✅ supports mock value once returning undefined
✅ mockReturnValueOnce mocks value just once
✅ supports mocking resolvable async functions
✅ supports mocking resolvable async functions only once
✅ supports mocking rejectable async functions
✅ supports mocking rejectable async functions only once
✅ tracks thrown errors without interfering with other tracking
✅ a call that throws undefined is tracked properly
✅ results of recursive calls are tracked properly
✅ test results of recursive calls from within the recursive call
✅ call mockClear inside recursive mock
moduleMocker generateFromMetadata mocked functions
✅ tracks calls to mocks
✅ tracks instances made by mocks
✅ supports clearing mock calls
✅ supports clearing mocks
✅ supports clearing all mocks
✅ supports resetting mock return values
✅ supports resetting single use mock return values
✅ supports resetting mock implementations
✅ supports resetting single use mock implementations
✅ supports resetting all mocks
✅ maintains function arity
moduleMocker generateFromMetadata return values
✅ tracks return values
✅ tracks mocked return values
✅ supports resetting return values
moduleMocker generateFromMetadata invocationCallOrder
✅ tracks invocationCallOrder made by mocks
✅ supports clearing mock invocationCallOrder
✅ supports clearing all mocks invocationCallOrder
✅ handles a property called `prototype`
moduleMocker getMockImplementation
✅ should mock calls to a mock function
moduleMocker mockImplementationOnce
✅ should mock constructor
✅ should mock single call to a mock function
✅ should fallback to default mock function when no specific mock is available
moduleMocker
✅ mockReturnValue does not override mockImplementationOnce
✅ mockImplementation resets the mock
✅ should recognize a mocked function
✅ default mockName is jest.fn()
✅ mockName sets the mock name
✅ mockName gets reset by mockReset
✅ mockName gets reset by mockRestore
✅ mockName is not reset by mockClear
moduleMocker spyOn
✅ should work
✅ should throw on invalid input
✅ supports restoring all spies
✅ should work with getters
moduleMocker spyOnProperty
✅ should work - getter
✅ should work - setter
✅ should throw on invalid input
✅ supports restoring all spies
✅ should work with getters on the prototype chain
✅ should work with setters on the prototype chain
✅ supports restoring all spies on the prototype chain
```
### ✅ packages/jest-regex-util/src/__tests__/index.test.ts
```
replacePathSepForRegex() posix
✅ should return the path
replacePathSepForRegex() win32
✅ should replace POSIX path separators
✅ should escape Windows path separators
✅ should not escape an escaped dot
✅ should not escape an escaped regexp symbol
✅ should escape Windows path separators inside groups
✅ should escape Windows path separator at the beginning
✅ should not escape several already escaped path separators
```
### ✅ packages/jest-repl/src/__tests__/jest_repl.test.js
```
Repl cli
✅ runs without errors
```
### ✅ packages/jest-repl/src/__tests__/runtime_cli.test.js
```
Runtime CLI
✅ fails with no path
✅ displays script output
✅ always disables automocking
✅ throws script errors
```
### ✅ packages/jest-reporters/src/__tests__/CoverageReporter.test.js
```
onRunComplete
✅ getLastError() returns an error when threshold is not met for global
✅ getLastError() returns an error when threshold is not met for file
✅ getLastError() returns `undefined` when threshold is met
✅ getLastError() returns an error when threshold is not met for non-covered file
✅ getLastError() returns an error when threshold is not met for directory
✅ getLastError() returns `undefined` when threshold is met for directory
✅ getLastError() returns an error when there is no coverage data for a threshold
✅ getLastError() returns 'undefined' when global threshold group
is empty because PATH and GLOB threshold groups have matched all the
files in the coverage data.
✅ getLastError() returns 'undefined' when file and directory path
threshold groups overlap
✅ that if globs or paths are specified alongside global, coverage
data for matching paths will be subtracted from overall coverage
and thresholds will be applied independently
✅ that files are matched by all matching threshold groups
✅ that it passes custom options when creating reporters
```
### ✅ packages/jest-reporters/src/__tests__/CoverageWorker.test.js
```
✅ resolves to the result of generateEmptyCoverage upon success
✅ throws errors on invalid JavaScript
```
### ✅ packages/jest-reporters/src/__tests__/DefaultReporter.test.js
```
✅ normal output, everything goes to stdout
✅ when using stderr as output, no stdout call is made
```
### ✅ packages/jest-reporters/src/__tests__/generateEmptyCoverage.test.js
```
generateEmptyCoverage
✅ generates an empty coverage object for a file without running it
✅ generates a null coverage result when using /* istanbul ignore file */
✅ generates a null coverage result when collectCoverage global config is false
```
### ✅ packages/jest-reporters/src/__tests__/getResultHeader.test.js
```
✅ should call `terminal-link` correctly
✅ should render the terminal link
✅ should display test time for slow test
✅ should not display test time for fast test
```
### ✅ packages/jest-reporters/src/__tests__/getSnapshotStatus.test.js
```
✅ Retrieves the snapshot status
✅ Shows no snapshot updates if all snapshots matched
✅ Retrieves the snapshot status after a snapshot update
```
### ✅ packages/jest-reporters/src/__tests__/getSnapshotSummary.test.js
```
✅ creates a snapshot summary
✅ creates a snapshot summary after an update
✅ creates a snapshot summary with multiple snapshot being written/updated
✅ returns nothing if there are no updates
```
### ✅ packages/jest-reporters/src/__tests__/getWatermarks.test.ts
```
getWatermarks
✅ that watermarks use thresholds as upper target
✅ that watermarks are created always created
```
### ✅ packages/jest-reporters/src/__tests__/NotifyReporter.test.ts
```
✅ test always
✅ test success
✅ test change
✅ test success-change
✅ test failure-change
✅ test always with rootDir
✅ test success with rootDir
✅ test change with rootDir
✅ test success-change with rootDir
✅ test failure-change with rootDir
✅ test always with moduleName
✅ test success with moduleName
✅ test change with moduleName
✅ test success-change with moduleName
✅ test failure-change with moduleName
node-notifier is an optional dependency
✅ without node-notifier uses mock function that throws an error
✅ throws the error when require throws an unexpected error
✅ uses node-notifier when it is available
```
### ✅ packages/jest-reporters/src/__tests__/SummaryReporter.test.js
```
✅ snapshots needs update with npm test
✅ snapshots needs update with yarn test
✅ snapshots all have results (no update)
✅ snapshots all have results (after update)
```
### ✅ packages/jest-reporters/src/__tests__/utils.test.ts
```
wrapAnsiString()
✅ wraps a long string containing ansi chars
✅ returns the string unaltered if given a terminal width of zero
trimAndFormatPath()
✅ trims dirname
✅ trims dirname (longer line width)
✅ trims dirname and basename
✅ does not trim anything
✅ split at the path.sep index
printDisplayName
✅ should default displayName color to white when displayName is a string
✅ should default displayName color to white when color is not a valid value
✅ should correctly print the displayName when color and name are valid values
```
### ✅ packages/jest-reporters/src/__tests__/VerboseReporter.test.js
```
groupTestsBySuites
✅ should handle empty results
✅ should group A1 in A
✅ should group A1 in A; B1 in B
✅ should group A1, A2 in A
✅ should group A1, A2 in A; B1, B2 in B
✅ should group AB1 in AB
✅ should group AB1, AB2 in AB
✅ should group A1 in A; AB1 in AB
✅ should group AB1 in AB; A1 in A
✅ should group AB1 in AB; CD1 in CD
✅ should group ABC1 in ABC; BC1 in BC; D1 in D; A1 in A
```
### ✅ packages/jest-resolve-dependencies/src/__tests__/dependency_resolver.test.ts
```
✅ resolves no dependencies for non-existent path
✅ resolves dependencies for existing path
✅ includes the mocks of dependencies as dependencies
✅ resolves dependencies for scoped packages
✅ resolves no inverse dependencies for empty paths set
✅ resolves no inverse dependencies for set of non-existent paths
✅ resolves inverse dependencies for existing path
✅ resolves inverse dependencies of mock
✅ resolves inverse dependencies from available snapshot
✅ resolves dependencies correctly when dependency resolution fails
✅ resolves dependencies correctly when mock dependency resolution fails
```
### ✅ packages/jest-resolve/src/__tests__/isBuiltinModule.test.ts
```
isBuiltinModule
✅ should return true for the `path` module
✅ should return false for the `chalk` module
✅ should return true for the `_http_common` module
✅ should return false for any internal node builtins
```
### ✅ packages/jest-resolve/src/__tests__/resolve.test.ts
```
isCoreModule
✅ returns false if `hasCoreModules` is false.
✅ returns true if `hasCoreModules` is true and `moduleName` is a core module.
✅ returns false if `hasCoreModules` is true and `moduleName` is not a core module.
✅ returns false if `hasCoreModules` is true and `moduleNameMapper` alias a module same name with core module
findNodeModule
✅ is possible to override the default resolver
✅ passes packageFilter to the resolve module when using the default resolver
resolveModule
✅ is possible to resolve node modules
✅ is possible to resolve node modules with custom extensions
✅ is possible to resolve node modules with custom extensions and platforms
✅ is possible to resolve node modules by resolving their realpath
✅ is possible to specify custom resolve paths
✅ does not confuse directories with files
getMockModule
✅ is possible to use custom resolver to resolve deps inside mock modules with moduleNameMapper
nodeModulesPaths
✅ provides custom module paths after node_modules
Resolver.getModulePaths() -> nodeModulesPaths()
✅ can resolve node modules relative to absolute paths in "moduleDirectories" on Windows platforms
✅ can resolve node modules relative to absolute paths in "moduleDirectories" on Posix platforms
```
### ✅ packages/jest-runner/src/__tests__/testRunner.test.ts
```
✅ injects the serializable module map into each worker in watch mode
✅ assign process.env.JEST_WORKER_ID = 1 when in runInBand mode
```
### ✅ packages/jest-runtime/src/__tests__/instrumentation.test.ts
```
✅ instruments files
```
### ✅ packages/jest-runtime/src/__tests__/runtime_create_mock_from_module.test.js
```
Runtime createMockFromModule
✅ does not cause side effects in the rest of the module system when generating a mock
✅ resolves mapped modules correctly
Runtime
✅ creates mock objects in the right environment
```
### ✅ packages/jest-runtime/src/__tests__/runtime_environment.test.js
```
Runtime requireModule
✅ emulates a node stack trace during module load
✅ emulates a node stack trace during function execution
```
### ✅ packages/jest-runtime/src/__tests__/runtime_internal_module.test.js
```
Runtime internalModule
✅ loads modules and applies transforms
✅ loads internal modules without applying transforms
✅ loads JSON modules and applies transforms
✅ loads internal JSON modules without applying transforms
```
### ✅ packages/jest-runtime/src/__tests__/runtime_jest_fn.js
```
Runtime jest.fn
✅ creates mock functions
✅ creates mock functions with mock implementations
Runtime jest.isMockFunction
✅ recognizes a mocked function
Runtime jest.clearAllMocks
✅ clears all mocks
```
### ✅ packages/jest-runtime/src/__tests__/runtime_jest_spy_on.test.js
```
Runtime jest.spyOn
✅ calls the original function
Runtime jest.spyOnProperty
✅ calls the original function
```
### ✅ packages/jest-runtime/src/__tests__/runtime_mock.test.js
```
Runtime jest.mock
✅ uses explicitly set mocks instead of automocking
✅ sets virtual mock for non-existing module required from same directory
✅ sets virtual mock for non-existing module required from different directory
Runtime jest.setMock
✅ uses explicitly set mocks instead of automocking
```
### ✅ packages/jest-runtime/src/__tests__/runtime_module_directories.test.js
```
Runtime
✅ uses configured moduleDirectories
✅ resolves packages
✅ finds closest module from moduleDirectories
✅ only checks the configured directories
```
### ✅ packages/jest-runtime/src/__tests__/runtime_node_path.test.js
```
Runtime
✅ uses NODE_PATH to find modules
✅ uses modulePaths to find modules
✅ finds modules in NODE_PATH containing multiple paths
✅ does not find modules if NODE_PATH is relative
```
### ✅ packages/jest-runtime/src/__tests__/runtime_require_actual.test.js
```
Runtime requireActual
✅ requires node module when manual mock exists
✅ requireActual with moduleNameMapper
```
### ✅ packages/jest-runtime/src/__tests__/runtime_require_cache.test.js
```
Runtime require.cache
✅ require.cache returns loaded module list as native Nodejs require does
✅ require.cache is tolerant readonly
```
### ✅ packages/jest-runtime/src/__tests__/runtime_require_mock.test.js
```
Runtime requireMock
✅ uses manual mocks before attempting to automock
✅ can resolve modules that are only referenced from mocks
✅ stores and re-uses manual mock exports
✅ automocks haste modules without a manual mock
✅ automocks relative-path modules without a file extension
✅ automocks relative-path modules with a file extension
✅ just falls back when loading a native module
✅ stores and re-uses automocked haste exports
✅ stores and re-uses automocked relative-path modules
✅ multiple node core modules returns correct module
✅ throws on non-existent haste modules
✅ uses manual mocks when using a custom resolver
✅ provides `require.main` in mock
```
### ✅ packages/jest-runtime/src/__tests__/runtime_require_module_no_ext.test.js
```
Runtime requireModule with no extension
✅ throws error pointing out file with extension
```
### ✅ packages/jest-runtime/src/__tests__/runtime_require_module_or_mock_transitive_deps.test.js
```
transitive dependencies
✅ mocks a manually mocked and mapped module
✅ unmocks transitive dependencies in node_modules by default
✅ unmocks transitive dependencies in node_modules when using unmock
✅ unmocks transitive dependencies in node_modules by default when using both patterns and unmock
✅ mocks deep dependencies when using unmock
✅ does not mock deep dependencies when using deepUnmock
```
### ✅ packages/jest-runtime/src/__tests__/runtime_require_module_or_mock.test.js
```
✅ mocks modules by default when using automocking
✅ doesn't mock modules when explicitly unmocked when using automocking
✅ doesn't mock modules when explicitly unmocked via a different name
✅ doesn't mock modules when disableAutomock() has been called
✅ uses manual mock when automocking on and mock is available
✅ does not use manual mock when automocking is off and a real module is available
✅ resolves mapped module names and unmocks them by default
✅ automocking is disabled by default
✅ unmocks modules in config.unmockedModulePathPatterns for tests with automock enabled when automock is false
✅ unmocks virtual mocks after they have been mocked previously
resetModules
✅ resets all the modules
isolateModules
✅ keeps it's registry isolated from global one
✅ resets all modules after the block
✅ resets module after failing
✅ cannot nest isolateModules blocks
✅ can call resetModules within a isolateModules block
isolateModules can use isolateModules from a beforeEach block
✅ can use the required module from beforeEach and re-require it
```
### ✅ packages/jest-runtime/src/__tests__/runtime_require_module.test.js
```
Runtime requireModule
✅ finds haste modules
✅ provides `module` to modules
✅ provides `module.parent` to modules
✅ `module.parent` should be undefined for entrypoints
✅ resolve module.parent.require correctly
✅ resolve module.parent.filename correctly
✅ provides `module.loaded` to modules
✅ provides `module.filename` to modules
✅ provides `module.paths` to modules
✅ provides `require.main` to modules
✅ throws on non-existent haste modules
✅ finds relative-path modules without file extension
✅ finds relative-path modules with file extension
✅ throws on non-existent relative-path modules
✅ finds node core built-in modules
✅ finds and loads JSON files without file extension
✅ finds and loads JSON files with file extension
✅ requires a JSON file twice successfully
✅ provides manual mock when real module doesnt exist
✅ doesn't override real modules with manual mocks when explicitly unmocked
✅ resolves haste packages properly
✅ resolves platform extensions based on the default platform
✅ finds modules encoded in UTF-8 *with BOM*
✅ finds and loads JSON files encoded in UTF-8 *with BOM*
✅ should export a constructable Module class
✅ caches Module correctly
Runtime requireModule on node >=12.12.0
✅ overrides module.createRequire
```
### ✅ packages/jest-runtime/src/__tests__/runtime_require_resolve.test.ts
```
Runtime require.resolve
✅ resolves a module path
✅ resolves a module path with moduleNameMapper
Runtime require.resolve with the jest-resolve-outside-vm-option
✅ forwards to the real Node require in an internal context
✅ ignores the option in an external context
✅ does not understand a self-constructed outsideJestVmPath in an external context
```
### ✅ packages/jest-runtime/src/__tests__/runtime_wrap.js
```
Runtime wrapCodeInModuleWrapper
✅ generates the correct args for the module wrapper
✅ injects "extra globals"
```
### ✅ packages/jest-runtime/src/__tests__/Runtime-sourceMaps.test.js
```
Runtime requireModule
✅ installs source maps if available
```
### ✅ packages/jest-runtime/src/__tests__/Runtime-statics.test.js
```
Runtime statics
✅ Runtime.createHasteMap passes correct ignore files to HasteMap
✅ Runtime.createHasteMap passes correct ignore files to HasteMap in watch mode
```
### ✅ packages/jest-serializer/src/__tests__/index.test.ts
```
Using V8 implementation
✅ throws the error with an invalid serialization
Using V8 implementation Object 0
✅ serializes/deserializes in memory
✅ serializes/deserializes in disk
Using V8 implementation Object 1
✅ serializes/deserializes in memory
✅ serializes/deserializes in disk
Using V8 implementation Object 2
✅ serializes/deserializes in memory
✅ serializes/deserializes in disk
Using V8 implementation Object 3
✅ serializes/deserializes in memory
✅ serializes/deserializes in disk
Using V8 implementation Object 4
✅ serializes/deserializes in memory
✅ serializes/deserializes in disk
Using V8 implementation Object 5
✅ serializes/deserializes in memory
✅ serializes/deserializes in disk
Using V8 implementation Object 6
✅ serializes/deserializes in memory
✅ serializes/deserializes in disk
Using V8 implementation Object 7
✅ serializes/deserializes in memory
✅ serializes/deserializes in disk
```
### ✅ packages/jest-snapshot/src/__tests__/dedentLines.test.ts
```
dedentLines non-null
✅ no lines
✅ one line empty string
✅ one line empty object
✅ one line self-closing element
✅ object value empty string
✅ object value string includes double-quote marks
✅ markup with props and text
✅ markup with components as props
dedentLines null
✅ object key multi-line
✅ object value multi-line
✅ object key and value multi-line
✅ markup prop multi-line
✅ markup prop component with multi-line text
✅ markup text multi-line
✅ markup text multiple lines
✅ markup unclosed self-closing start tag
✅ markup unclosed because no end tag
```
### ✅ packages/jest-snapshot/src/__tests__/InlineSnapshots.test.ts
```
✅ saveInlineSnapshots() replaces empty function call with a template literal
✅ saveInlineSnapshots() without prettier leaves formatting outside of snapshots alone
✅ saveInlineSnapshots() can handle typescript without prettier
✅ saveInlineSnapshots() can handle tsx without prettier
✅ saveInlineSnapshots() can handle flow and jsx without prettier
✅ saveInlineSnapshots() can use prettier to fix formatting for whole file
✅ saveInlineSnapshots() replaces existing template literal - babel parser
✅ saveInlineSnapshots() replaces existing template literal - flow parser
✅ saveInlineSnapshots() replaces existing template literal - typescript parser
✅ saveInlineSnapshots() replaces existing template literal with property matchers
✅ saveInlineSnapshots() creates template literal with property matchers
✅ saveInlineSnapshots() creates template literal with property matchers
✅ saveInlineSnapshots() throws if frame does not match
✅ saveInlineSnapshots() throws if multiple calls to to the same location
✅ saveInlineSnapshots() uses escaped backticks
✅ saveInlineSnapshots() works with non-literals in expect call
✅ saveInlineSnapshots() indents multi-line snapshots with spaces
✅ saveInlineSnapshots() does not re-indent error snapshots
✅ saveInlineSnapshots() does not re-indent already indented snapshots
✅ saveInlineSnapshots() indents multi-line snapshots with tabs
✅ saveInlineSnapshots() indents snapshots after prettier reformats
✅ saveInlineSnapshots() does not indent empty lines
```
### ✅ packages/jest-snapshot/src/__tests__/matcher.test.ts
```
✅ matcher returns matcher name, expected and actual values
```
### ✅ packages/jest-snapshot/src/__tests__/mockSerializer.test.ts
```
✅ mock with 0 calls and default name
✅ mock with 2 calls, 1 return, 1 throw
✅ mock with 0 calls and default name in React element
✅ mock with 0 calls and non-default name
✅ mock with 1 calls and non-default name via new in object
✅ mock with 1 calls in React element
✅ mock with 2 calls
✅ indent option
✅ min option
✅ maxDepth option
```
### ✅ packages/jest-snapshot/src/__tests__/printSnapshot.test.ts
```
chalk
✅ level 0
✅ level 1
✅ level 2
✅ level 3
matcher error toMatchInlineSnapshot
✅ Expected properties must be an object (non-null) without snapshot
✅ Expected properties must be an object (null) with snapshot
✅ Inline snapshot must be a string
✅ Snapshot matchers cannot be used with not
matcher error toMatchSnapshot
✅ Expected properties must be an object (non-null)
✅ Expected properties must be an object (null) with hint
✅ Expected properties must be an object (null) without hint
✅ Snapshot state must be initialized
matcher error toMatchSnapshot received value must be an object
✅ (non-null)
✅ (null)
matcher error toThrowErrorMatchingInlineSnapshot
✅ Inline snapshot must be a string
✅ Snapshot state must be initialized
matcher error toThrowErrorMatchingSnapshot
✅ Received value must be a function
✅ Snapshot matchers cannot be used with not
other error toThrowErrorMatchingSnapshot
✅ Received function did not throw
pass false toMatchInlineSnapshot with properties equals false
✅ with snapshot
✅ without snapshot
pass false toMatchInlineSnapshot with properties
✅ equals true
pass false toMatchSnapshot
✅ New snapshot was not written (multi line)
✅ New snapshot was not written (single line)
pass false toMatchSnapshot with properties equals false
✅ isLineDiffable false
✅ isLineDiffable true
pass false toMatchSnapshot with properties
✅ equals true
pass false toThrowErrorMatchingInlineSnapshot
✅ with snapshot
pass true toMatchSnapshot
✅ without properties
printPropertiesAndReceived
✅ omit missing properties
printSnapshotAndReceived backtick
✅ single line expected and received
printSnapshotAndReceived empty string
✅ expected and received single line
✅ received and expected multi line
printSnapshotAndReceived escape
✅ double quote marks in string
✅ backslash in multi line string
✅ backslash in single line string
✅ regexp
printSnapshotAndReceived expand
✅ false
✅ true
printSnapshotAndReceived
✅ fallback to line diff
✅ multi line small change in one line and other is unchanged
✅ multi line small changes
✅ single line large changes
printSnapshotAndReceived has no common after clean up chaff
✅ array
✅ string single line
printSnapshotAndReceived MAX_DIFF_STRING_LENGTH unquoted
✅ both are less
✅ expected is more
✅ received is more
printSnapshotAndReceived MAX_DIFF_STRING_LENGTH quoted
✅ both are less
✅ expected is more
✅ received is more
printSnapshotAndReceived isLineDiffable false
✅ asymmetric matcher
✅ boolean
✅ date
✅ error
✅ function
✅ number
printSnapshotAndReceived isLineDiffable true
✅ array
✅ object
✅ single line expected and received
✅ single line expected and multi line received
printSnapshotAndReceived ignore indentation
✅ markup delete
✅ markup fall back
✅ markup insert
printSnapshotAndReceived ignore indentation object
✅ delete
✅ insert
printSnapshotAndReceived without serialize
✅ backtick single line expected and received
✅ backtick single line expected and multi line received
✅ has no common after clean up chaff multi line
✅ has no common after clean up chaff single line
✅ prettier/pull/5590
```
### ✅ packages/jest-snapshot/src/__tests__/SnapshotResolver.test.ts
```
defaults
✅ returns cached object if called multiple times
✅ resolveSnapshotPath()
✅ resolveTestPath()
custom resolver in project config
✅ returns cached object if called multiple times
✅ resolveSnapshotPath()
✅ resolveTestPath()
malformed custom resolver in project config
✅ missing resolveSnapshotPath throws
✅ missing resolveTestPath throws
✅ missing testPathForConsistencyCheck throws
✅ inconsistent functions throws
```
### ✅ packages/jest-snapshot/src/__tests__/throwMatcher.test.ts
```
✅ throw matcher can take func
throw matcher from promise
✅ can take error
✅ can take custom error
```
### ✅ packages/jest-snapshot/src/__tests__/utils.test.ts
```
✅ keyToTestName()
✅ testNameToKey
✅ saveSnapshotFile() works with
✅ saveSnapshotFile() works with
✅ getSnapshotData() throws when no snapshot version
✅ getSnapshotData() throws for older snapshot version
✅ getSnapshotData() throws for newer snapshot version
✅ getSnapshotData() does not throw for when updating
✅ getSnapshotData() marks invalid snapshot dirty when updating
✅ getSnapshotData() marks valid snapshot not dirty when updating
✅ escaping
✅ serialize handles \r\n
ExtraLineBreaks
✅ 0 empty string
✅ 1 line has double quote marks at edges
✅ 1 line has spaces at edges
✅ 2 lines both are blank
✅ 2 lines have double quote marks at edges
✅ 2 lines first is blank
✅ 2 lines last is blank
removeLinesBeforeExternalMatcherTrap
✅ contains external matcher trap
✅ doesn't contain external matcher trap
DeepMerge with property matchers
✅ Correctly merges a nested object
✅ Correctly merges an object with an array of objects
✅ Correctly merges an object with an array of strings
✅ Correctly merges an array of objects
✅ Correctly merges an array of arrays
```
### ✅ packages/jest-source-map/src/__tests__/getCallsite.test.ts
```
getCallsite
✅ without source map
✅ ignores errors when fs throws
✅ reads source map file to determine line and column
```
### ✅ packages/jest-test-result/src/__tests__/formatTestResults.test.ts
```
formatTestResults
✅ includes test full name
```
### ✅ packages/jest-test-sequencer/src/__tests__/test_sequencer.test.js
```
✅ sorts by file size if there is no timing information
✅ sorts based on timing information
✅ sorts based on failures and timing information
✅ sorts based on failures, timing information and file size
✅ writes the cache based on results without existing cache
✅ returns failed tests in sorted order
✅ writes the cache based on the results
✅ works with multiple contexts
```
### ✅ packages/jest-transform/src/__tests__/ScriptTransformer.test.ts
```
ScriptTransformer
✅ transforms a file properly
✅ does not transform Node core modules
✅ throws an error if `process` doesn't return a string or an objectcontaining `code` key with processed string
✅ throws an error if `process` doesn't defined
✅ throws an error if createTransformer returns object without `process` method
✅ shouldn't throw error without process method. But with corrent createTransformer method
✅ uses the supplied preprocessor
✅ uses multiple preprocessors
✅ writes source map if preprocessor supplies it
✅ writes source map if preprocessor inlines it
✅ warns of unparseable inlined source maps from the preprocessor
✅ writes source maps if given by the transformer
✅ does not write source map if not given by the transformer
✅ should write a source map for the instrumented file when transformed
✅ should write a source map for the instrumented file when not transformed
✅ passes expected transform options to getCacheKey
✅ creates transformer with config
✅ reads values from the cache
✅ reads values from the cache when the file contains colons
✅ should reuse the value from in-memory cache which is set by custom transformer
✅ does not reuse the in-memory cache between different projects
✅ preload transformer when using `preloadTransformer`
```
### ✅ packages/jest-transform/src/__tests__/shouldInstrument.test.ts
```
shouldInstrument should return true
✅ when testRegex is provided and file is not a test file
✅ when more than one testRegex is provided and filename is not a test file
✅ when testMatch is provided and file is not a test file
✅ when testPathIgnorePatterns is provided and file is not a test file
✅ when more than one testPathIgnorePatterns is provided and filename is not a test file
✅ when testRegex and testPathIgnorePatterns are provided and file is not a test file
✅ when testMatch and testPathIgnorePatterns are provided and file is not a test file
✅ should return true when file is in collectCoverageOnlyFrom when provided
✅ should return true when filename matches collectCoverageFrom
✅ should return true if the file is not in coveragePathIgnorePatterns
✅ should return true if file is a testfile but forceCoverageMatch is set
shouldInstrument should return false
✅ if collectCoverage is falsy
✅ when testRegex is provided and filename is a test file
✅ when more than one testRegex is provided and filename matches one of the patterns
✅ when testMatch is provided and file is a test file
✅ when testRegex and testPathIgnorePatterns are provided and filename is a test file
✅ when testMatch and testPathIgnorePatterns are provided and file is a test file
✅ when file is not in collectCoverageOnlyFrom when provided
✅ when filename does not match collectCoverageFrom
✅ if the file is in coveragePathIgnorePatterns
✅ if file is in mock patterns
✅ if file is a globalSetup file
✅ if file is globalTeardown file
✅ if file is in setupFiles
✅ if file is in setupFilesAfterEnv
```
### ✅ packages/jest-util/src/__tests__/createProcessObject.test.ts
```
✅ creates a process object that looks like the original one
✅ fakes require("process") so it is equal to "global.process"
✅ checks that process.env works as expected on Linux platforms
✅ checks that process.env works as expected in Windows platforms
```
### ✅ packages/jest-util/src/__tests__/deepCyclicCopy.test.ts
```
✅ returns the same value for primitive or function values
✅ does not execute getters/setters, but copies them
✅ copies symbols
✅ copies arrays as array objects
✅ handles cyclic dependencies
✅ uses the blacklist to avoid copying properties on the first level
✅ does not keep the prototype by default when top level is object
✅ does not keep the prototype by default when top level is array
✅ does not keep the prototype of arrays when keepPrototype = false
✅ keeps the prototype of arrays when keepPrototype = true
✅ does not keep the prototype for objects when keepPrototype = false
✅ keeps the prototype for objects when keepPrototype = true
```
### ✅ packages/jest-util/src/__tests__/errorWithStack.test.ts
```
ErrorWithStack
✅ calls Error.captureStackTrace with given callsite when capture exists
```
### ✅ packages/jest-util/src/__tests__/formatTime.test.ts
```
✅ defaults to milliseconds
✅ formats seconds properly
✅ formats milliseconds properly
✅ formats microseconds properly
✅ formats nanoseconds properly
✅ interprets lower than lowest powers as nanoseconds
✅ interprets higher than highest powers as seconds
✅ interprets non-multiple-of-3 powers as next higher prefix
✅ formats the quantity properly when pad length is lower
✅ formats the quantity properly when pad length is equal
✅ left pads the quantity properly when pad length is higher
```
### ✅ packages/jest-util/src/__tests__/globsToMatcher.test.ts
```
✅ works like micromatch with only positive globs
✅ works like micromatch with a mix of overlapping positive and negative globs
✅ works like micromatch with only negative globs
✅ works like micromatch with empty globs
```
### ✅ packages/jest-util/src/__tests__/installCommonGlobals.test.ts
```
✅ returns the passed object
✅ turns a V8 global object into a Node global object
```
### ✅ packages/jest-util/src/__tests__/isInteractive.test.ts
```
✅ Returns true when running on interactive environment
✅ Returns false when running on a non-interactive environment
```
### ✅ packages/jest-util/src/__tests__/isPromise.test.ts
```
not a Promise:
✅ undefined
✅ null
✅ true
✅ 42
✅ "1337"
✅ Symbol()
✅ []
✅ {}
✅ a resolved Promise
✅ a rejected Promise
```
### ✅ packages/jest-validate/src/__tests__/validate.test.ts
```
✅ recursively validates default Jest config
✅ recursively validates default jest-validate config
✅ pretty prints valid config for Boolean
✅ pretty prints valid config for Array
✅ pretty prints valid config for String
✅ pretty prints valid config for Object
✅ pretty prints valid config for Function
✅ omits null and undefined config values
✅ recursively omits null and undefined config values
✅ treat async and non-async functions as equivalent
✅ treat async and non-async functions as equivalent
✅ treat async and non-async functions as equivalent
✅ treat async and non-async functions as equivalent
✅ respects recursiveDenylist
✅ displays warning for unknown config options
✅ displays warning for deprecated config options
✅ works with custom warnings
✅ works with custom errors
✅ works with custom deprecations
✅ works with multiple valid types
✅ reports errors nicely when failing with multiple valid options
✅ Repeated types within multiple valid examples are coalesced in error report
✅ Comments in config JSON using "//" key are not warned
```
### ✅ packages/jest-validate/src/__tests__/validateCLIOptions.test.js
```
✅ validates yargs special options
✅ validates testURL
✅ fails for unknown option
✅ fails for multiple unknown options
✅ does not show suggestion when unrecognized cli param length <= 1
✅ shows suggestion when unrecognized cli param length > 1
```
### ✅ packages/jest-watcher/src/lib/__tests__/formatTestNameByPattern.test.ts
```
for multiline test name returns
✅ test name with highlighted pattern and replaced line breaks
for one line test name with pattern in the head returns
✅ test name with highlighted pattern
✅ test name with cutted tail and highlighted pattern
✅ test name with cutted tail and cutted highlighted pattern
for one line test name pattern in the middle
✅ test name with highlighted pattern returns
✅ test name with cutted tail and highlighted pattern
✅ test name with cutted tail and cutted highlighted pattern
✅ test name with highlighted cutted
for one line test name pattern in the tail returns
✅ test name with highlighted pattern
✅ test name with cutted tail and cutted highlighted pattern
✅ test name with highlighted cutted
```
### ✅ packages/jest-watcher/src/lib/__tests__/prompt.test.ts
```
✅ calls handler on change value
✅ calls handler on success prompt
✅ calls handler on cancel prompt
```
### ✅ packages/jest-watcher/src/lib/__tests__/scroll.test.ts
```
✅ When offset is -1
✅ When offset is in the first set of items
✅ When offset is in the middle of the list
✅ When offset is at the end of the list
✅ When offset is at the end and size is smaller than max
```
### ✅ packages/jest-worker/src/__tests__/Farm.test.js
```
Farm
✅ sends a request to one worker
✅ sends four requests to four unique workers
✅ handles null computeWorkerKey, sending to first worker
✅ sends the same worker key to the same worker
✅ returns the result if the call worked
✅ throws if the call failed
✅ checks that once a sticked task finishes, next time is sent to that worker
✅ checks that even before a sticked task finishes, next time is sent to that worker
✅ checks that locking works, and jobs are never lost
✅ can receive custom messages from workers
```
### ✅ packages/jest-worker/src/__tests__/FifoQueue.test.js
```
✅ returns the shared tasks in FIFO ordering
✅ returns the worker specific tasks in FIFO ordering
✅ maintains global FIFO ordering between worker specific and shared tasks
```
### ✅ packages/jest-worker/src/__tests__/index.test.js
```
✅ exposes the right API using default working
✅ exposes the right API using passed worker
✅ breaks if any of the forbidden methods is tried to be exposed
✅ works with minimal options
✅ does not let make calls after the farm is ended
✅ does not let end the farm after it is ended
✅ calls doWork
✅ calls getStderr and getStdout from worker
```
### ✅ packages/jest-worker/src/__tests__/PriorityQueue.test.js
```
✅ returns the tasks in order
✅ returns the task with the lowest priority value if inserted in reversed order
✅ returns the task with the lowest priority value if inserted in correct order
✅ uses different queues for each worker
✅ process task in the global and shared queue in order
```
### ✅ packages/jest-worker/src/__tests__/process-integration.test.js
```
Jest Worker Integration
✅ calls a single method from the worker
✅ distributes sequential calls across child processes
✅ schedules the task on the first available child processes if the scheduling policy is in-order
✅ distributes concurrent calls across child processes
✅ sticks parallel calls to children
```
### ✅ packages/jest-worker/src/__tests__/thread-integration.test.js
```
Jest Worker Process Integration
✅ calls a single method from the worker
✅ distributes sequential calls across child processes
✅ schedules the task on the first available child processes if the scheduling policy is in-order
✅ schedules the task on the first available child processes
✅ distributes concurrent calls across child processes
✅ sticks parallel calls to children
```
### ✅ packages/jest-worker/src/__tests__/WorkerPool.test.js
```
WorkerPool
✅ should create a ChildProcessWorker and send to it
✅ should create a NodeThreadWorker and send to it
✅ should avoid NodeThreadWorker if not passed enableWorkerThreads
```
### ✅ packages/jest-worker/src/base/__tests__/BaseWorkerPool.test.js
```
BaseWorkerPool
✅ throws error when createWorker is not defined
✅ creates and exposes n workers
✅ creates and expoeses n workers
✅ creates workers with the right options
✅ makes a non-existing relative worker throw
✅ create multiple workers with unique worker ids
✅ aggregates all stdouts and stderrs from all workers
✅ works when stdout and stderr are not piped to the parent
BaseWorkerPool end
✅ ends all workers
✅ resolves with forceExited=false if workers exited gracefully
✅ force exits workers that do not exit gracefully and resolves with forceExited=true
```
### ✅ packages/jest-worker/src/workers/__tests__/ChildProcessWorker.test.js
```
✅ passes fork options down to child_process.fork, adding the defaults
✅ passes workerId to the child process and assign it to 1-indexed env.JEST_WORKER_ID
✅ initializes the child process with the given workerPath
✅ stops initializing the worker after the amount of retries is exceeded
✅ provides stdout and stderr from the child processes
✅ sends the task to the child process
✅ resends the task to the child process after a retry
✅ calls the onProcessStart method synchronously if the queue is empty
✅ can send multiple messages to parent
✅ creates error instances for known errors
✅ throws when the child process returns a strange message
✅ does not restart the child if it cleanly exited
✅ resolves waitForExit() after the child process cleanly exited
✅ restarts the child when the child process dies
✅ sends SIGTERM when forceExit() is called
✅ sends SIGKILL some time after SIGTERM
✅ does not send SIGKILL if SIGTERM exited the process
```
### ✅ packages/jest-worker/src/workers/__tests__/NodeThreadsWorker.test.js
```
✅ passes fork options down to child_process.fork, adding the defaults
✅ passes workerId to the thread and assign it to env.JEST_WORKER_ID
✅ initializes the thread with the given workerPath
✅ stops initializing the worker after the amount of retries is exceeded
✅ provides stdout and stderr from the threads
✅ sends the task to the thread
✅ resends the task to the thread after a retry
✅ calls the onProcessStart method synchronously if the queue is empty
✅ can send multiple messages to parent
✅ creates error instances for known errors
✅ throws when the thread returns a strange message
✅ does not restart the thread if it cleanly exited
✅ resolves waitForExit() after the thread cleanly exited
✅ restarts the thread when the thread dies
✅ terminates the thread when forceExit() is called
```
### ✅ packages/jest-worker/src/workers/__tests__/processChild.test.js
```
✅ lazily requires the file
✅ calls initialize with the correct arguments
✅ returns results immediately when function is synchronous
✅ returns results when it gets resolved if function is asynchronous
✅ calls the main module if the method call is "default"
✅ calls the main export if the method call is "default" and it is a Babel transpiled one
✅ removes the message listener on END message
✅ calls the teardown method
✅ throws if an invalid message is detected
✅ throws if child is not forked
```
### ✅ packages/jest-worker/src/workers/__tests__/threadChild.test.js
```
✅ lazily requires the file
✅ calls initialize with the correct arguments
✅ returns results immediately when function is synchronous
✅ returns results when it gets resolved if function is asynchronous
✅ calls the main module if the method call is "default"
✅ calls the main export if the method call is "default" and it is a Babel transpiled one
✅ removes the message listener on END message
✅ calls the teardown method
✅ throws if an invalid message is detected
✅ throws if child is not forked
```
### ✅ packages/pretty-format/src/__tests__/AsymmetricMatcher.test.ts
```
✅ supports any(String)
✅ supports nested any(String)
✅ supports any(Function)
✅ supports nested any(Function)
✅ supports any(Array)
✅ supports nested any(Array)
✅ supports any(Object)
✅ supports nested any(Object)
✅ supports any(RegExp)
✅ supports nested any(RegExp)
✅ supports any(Symbol)
✅ supports nested any(Symbol)
✅ supports any(Function)
✅ supports nested any(Function)
✅ supports any()
✅ supports nested any()
✅ supports any(namedFuntction)
✅ supports nested any(namedFuntction)
✅ anything()
✅ arrayContaining()
✅ arrayNotContaining()
✅ objectContaining()
✅ objectNotContaining()
✅ stringContaining(string)
✅ not.stringContaining(string)
✅ stringMatching(string)
✅ stringMatching(regexp)
✅ stringMatching(regexp) {escapeRegex: false}
✅ stringMatching(regexp) {escapeRegex: true}
✅ stringNotMatching(string)
✅ supports multiple nested asymmetric matchers
✅ min option
indent option
✅ default implicit: 2 spaces
✅ default explicit: 2 spaces
✅ non-default: 0 spaces
✅ non-default: 4 spaces
maxDepth option
✅ matchers as leaf nodes
✅ matchers as internal nodes
```
### ✅ packages/pretty-format/src/__tests__/ConvertAnsi.test.ts
```
ConvertAnsi plugin
✅ supports style.red
✅ supports style.green
✅ supports style.reset
✅ supports style.bold
✅ supports style.dim
✅ does not support other colors
```
### ✅ packages/pretty-format/src/__tests__/DOMCollection.test.ts
```
DOMCollection plugin for object properties
✅ supports DOMStringMap
✅ supports NamedNodeMap
✅ supports config.min option
DOMCollection plugin for list items
✅ supports HTMLCollection for getElementsByTagName
✅ supports HTMLCollection for children
✅ supports config.maxDepth option
✅ supports NodeList for querySelectorAll
✅ supports NodeList for childNodes
✅ supports HTMLOptionsCollection for select options
✅ supports HTMLCollection for form elements
```
### ✅ packages/pretty-format/src/__tests__/DOMElement.test.ts
```
pretty-format
✅ prints global window as constructor name alone
DOMElement Plugin
✅ supports a single HTML element
✅ supports an HTML element with a class property
✅ supports an HTML element with a title property
✅ escapes double quote in attribute value
✅ supports an HTML element with a single attribute
✅ supports an HTML element with multiple attributes
✅ supports an HTML element with attribute and text content
✅ supports an element with text content
✅ supports nested elements
✅ supports nested elements with attributes
✅ supports nested elements with attribute and text content
✅ supports nested elements with text content
✅ supports siblings
✅ supports multiline text node in pre
✅ supports multiline text node preceding span in pre
✅ supports multiline text node in textarea
✅ supports empty text node
✅ supports non-empty text node
✅ supports comment node
✅ supports fragment node
✅ supports custom elements
✅ supports SVG elements
✅ supports indentation for array of elements
✅ supports maxDepth option
✅ handles `tagName` not being a string
DOMElement Plugin matches constructor name of SVG elements
✅ jsdom 9 and 10
✅ jsdom 11
```
### ✅ packages/pretty-format/src/__tests__/Immutable.test.ts
```
✅ does not incorrectly match identity-obj-proxy as Immutable object
Immutable.OrderedSet
✅ supports an empty collection {min: true}
✅ supports an empty collection {min: false}
✅ supports a single string element
✅ supports a single integer element
✅ supports multiple string elements {min: true}
✅ supports multiple string elements {min: false}
✅ supports multiple integer elements {min: true}
✅ supports multiple integer elements {min: false}
✅ supports object elements {min: true}
✅ supports object elements {min: false}
✅ supports React elements {min: true}
✅ supports React elements {min: false}
Immutable.List
✅ supports an empty collection {min: true}
✅ supports an empty collection {min: false}
✅ supports a single string element
✅ supports a single integer element
✅ supports multiple string elements {min: true}
✅ supports multiple string elements {min: false}
✅ supports multiple integer elements {min: true}
✅ supports multiple integer elements {min: false}
✅ supports object elements {min: true}
✅ supports object elements {min: false}
✅ supports React elements {min: true}
✅ supports React elements {min: false}
Immutable.Stack
✅ supports an empty collection {min: true}
✅ supports an empty collection {min: false}
✅ supports a single string element
✅ supports a single integer element
✅ supports multiple string elements {min: true}
✅ supports multiple string elements {min: false}
✅ supports multiple integer elements {min: true}
✅ supports multiple integer elements {min: false}
✅ supports object elements {min: true}
✅ supports object elements {min: false}
✅ supports React elements {min: true}
✅ supports React elements {min: false}
Immutable.Set
✅ supports an empty collection {min: true}
✅ supports an empty collection {min: false}
✅ supports a single string element
✅ supports a single integer element
✅ supports multiple string elements {min: true}
✅ supports multiple string elements {min: false}
✅ supports multiple integer elements {min: true}
✅ supports multiple integer elements {min: false}
✅ supports object elements {min: true}
✅ supports object elements {min: false}
✅ supports React elements {min: true}
✅ supports React elements {min: false}
Immutable.Map
✅ supports an empty collection {min: true}
✅ supports an empty collection {min: false}
✅ supports an object with single key
✅ supports an object with multiple keys {min: true}
✅ supports an object with multiple keys {min: false}
✅ supports object elements {min: true}
✅ supports object elements {min: false}
✅ supports React elements {min: true}
✅ supports React elements {min: false}
Immutable.OrderedMap
✅ supports an empty collection {min: true}
✅ supports an empty collection {min: false}
✅ supports an object with single key
✅ supports an object with multiple keys {min: true}
✅ supports an object with multiple keys {min: false}
✅ supports object elements {min: true}
✅ supports object elements {min: false}
✅ supports React elements {min: true}
✅ supports React elements {min: false}
✅ supports non-string keys
Immutable.Record
✅ supports an empty record {min: true}
✅ supports an empty record {min: false}
✅ supports a record with descriptive name
✅ supports a record without descriptive name
✅ supports a record with values {min: true}
✅ supports a record with values {min: false}
✅ supports a record with Map value {min: true}
✅ supports a record with Map value {min: false}
✅ supports imbricated Record {min: true}
✅ supports imbricated Record {min: false}
indentation of heterogeneous collections
✅ empty Immutable.List as child of Object
✅ empty Immutable.Map as child of Array
✅ non-empty Array as child of Immutable.Map
✅ non-empty Object as child of Immutable.List
indent option
✅ default implicit: 2 spaces
✅ default explicit: 2 spaces
✅ non-default: 0 spaces
✅ non-default: 4 spaces
maxDepth option
✅ Immutable.List as child of Object
✅ Immutable.Map as child of Array
✅ Immutable.Seq as child of Immutable.Map
✅ Immutable.Map as descendants in immutable collection
Immutable.Seq
✅ supports an empty sequence from array {min: true}
✅ supports an empty sequence from array {min: false}
✅ supports a non-empty sequence from array {min: true}
✅ supports a non-empty sequence from array {min: false}
✅ supports a non-empty sequence from arguments
✅ supports an empty sequence from object {min: true}
✅ supports an empty sequence from object {min: false}
✅ supports a non-empty sequence from object {min: true}
✅ supports a non-empty sequence from object {min: false}
✅ supports a sequence of entries from Immutable.Map
✅ supports a sequence of values from ECMAScript Set
✅ supports a sequence of values from Immutable.List
✅ supports a sequence of values from Immutable.Set
✅ supports a sequence of values from Immutable.Stack
Immutable.Seq lazy entries
✅ from object properties
✅ from Immutable.Map entries
Immutable.Seq lazy values
✅ from Immutable.Range
✅ from iterator
✅ from array items
✅ from Immutable.List values
✅ from ECMAScript Set values
```
### ✅ packages/pretty-format/src/__tests__/prettyFormat.test.ts
```
prettyFormat()
✅ prints empty arguments
✅ prints arguments
✅ prints an empty array
✅ prints an array with items
✅ prints a empty typed array
✅ prints a typed array with items
✅ prints an array buffer
✅ prints a nested array
✅ prints true
✅ prints false
✅ prints an error
✅ prints a typed error with a message
✅ prints a function constructor
✅ prints an anonymous callback function
✅ prints an anonymous assigned function
✅ prints a named function
✅ prints a named generator function
✅ can customize function names
✅ prints Infinity
✅ prints -Infinity
✅ prints an empty map
✅ prints a map with values
✅ prints a map with non-string keys
✅ prints NaN
✅ prints null
✅ prints a positive number
✅ prints a negative number
✅ prints zero
✅ prints negative zero
✅ prints a positive bigint
✅ prints a negative bigint
✅ prints zero bigint
✅ prints negative zero bigint
✅ prints a date
✅ prints an invalid date
✅ prints an empty object
✅ prints an object with properties
✅ prints an object with properties and symbols
✅ prints an object without non-enumerable properties which have string key
✅ prints an object without non-enumerable properties which have symbol key
✅ prints an object with sorted properties
✅ prints regular expressions from constructors
✅ prints regular expressions from literals
✅ prints regular expressions {escapeRegex: false}
✅ prints regular expressions {escapeRegex: true}
✅ escapes regular expressions nested inside object
✅ prints an empty set
✅ prints a set with values
✅ prints a string
✅ prints and escape a string
✅ doesn't escape string with {excapeString: false}
✅ prints a string with escapes
✅ prints a multiline string
✅ prints a multiline string as value of object property
✅ prints a symbol
✅ prints undefined
✅ prints a WeakMap
✅ prints a WeakSet
✅ prints deeply nested objects
✅ prints circular references
✅ prints parallel references
✅ can customize the max depth
✅ throws on invalid options
✅ supports plugins
✅ supports plugins that return empty string
✅ throws if plugin does not return a string
✅ throws PrettyFormatPluginError if test throws an error
✅ throws PrettyFormatPluginError if print throws an error
✅ throws PrettyFormatPluginError if serialize throws an error
✅ supports plugins with deeply nested arrays (#24)
✅ should call plugins on nested basic values
✅ prints objects with no constructor
✅ prints identity-obj-proxy with string constructor
✅ calls toJSON and prints its return value
✅ calls toJSON and prints an internal representation.
✅ calls toJSON only on functions
✅ does not call toJSON recursively
✅ calls toJSON on Sets
✅ disables toJSON calls through options
prettyFormat() indent option
✅ default implicit: 2 spaces
✅ default explicit: 2 spaces
✅ non-default: 0 spaces
✅ non-default: 4 spaces
prettyFormat() min
✅ prints some basic values in min mode
✅ prints some complex values in min mode
✅ does not allow indent !== 0 in min mode
```
### ✅ packages/pretty-format/src/__tests__/react.test.tsx
```
✅ supports a single element with no props or children
✅ supports a single element with non-empty string child
✅ supports a single element with empty string child
✅ supports a single element with non-zero number child
✅ supports a single element with zero number child
✅ supports a single element with mixed children
✅ supports props with strings
✅ supports props with multiline strings
✅ supports props with numbers
✅ supports a single element with a function prop
✅ supports a single element with a object prop
✅ supports an element with and object prop and children
✅ supports an element with complex props and mixed children
✅ escapes children properly
✅ supports everything all together
✅ sorts props in nested components
✅ supports a single element with React elements as props
✅ supports a single element with React elements with props
✅ supports a single element with custom React elements with props
✅ supports a single element with custom React elements with props (using displayName)
✅ supports a single element with custom React elements with props (using anonymous function)
✅ supports a single element with custom React elements with a child
✅ supports undefined element type
✅ supports a fragment with no children
✅ supports a fragment with string child
✅ supports a fragment with element child
✅ supports suspense
✅ supports a single element with React elements with a child
✅ supports a single element with React elements with children
✅ supports a single element with React elements with array children
✅ supports array of elements
✅ min option
✅ ReactElement plugin highlights syntax
✅ ReactTestComponent plugin highlights syntax
✅ throws if theme option is null
✅ throws if theme option is not of type "object"
✅ throws if theme option has value that is undefined in ansi-styles
✅ ReactElement plugin highlights syntax with color from theme option
✅ ReactTestComponent plugin highlights syntax with color from theme option
✅ supports forwardRef with a child
✅ supports context Provider with a child
✅ supports context Consumer with a child
✅ ReactElement removes undefined props
✅ ReactTestComponent removes undefined props
test object for subset match
✅ undefined props
✅ undefined children
indent option
✅ default implicit: 2 spaces
✅ default explicit: 2 spaces
✅ non-default: 0 spaces
✅ non-default: 4 spaces
maxDepth option
✅ elements
✅ array of elements
React.memo without displayName
✅ renders the component name
React.memo with displayName
✅ renders the displayName of component before memoizing
✅ renders the displayName of memoized component
```
### ✅ packages/pretty-format/src/__tests__/ReactElement.test.ts
```
ReactElement Plugin
✅ serializes forwardRef without displayName
✅ serializes forwardRef with displayName
✅ serializes forwardRef component with displayName
```