question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[jest.config.ts] `maxWorkers` and `rootDir` should be optional in Config.InitialOptions

See original GitHub issue

🐛 Bug Report

I’ve tried to create jest.config.ts from the documentation example

import type { Config } from '@jest/types';

const config : Config.InitialOptions = {
  verbose: true
};

export default config;

And got an error

Type '{ verbose: true; }' is missing the following properties from type 'InitialOptions': maxWorkers, rootDir

envinfo

  System:
    OS: macOS 10.15.7
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Binaries:
    Node: 14.13.0 - ~/.nvm/versions/node/v14.13.0/bin/node
    npm: 6.14.8 - ~/.nvm/versions/node/v14.13.0/bin/npm
  npmPackages:
    jest: ^26.6.0 => 26.6.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Ky6ukcommented, Oct 22, 2020

Yeah. It looks like some of the other packages require and have installed the oldest version of the @jest/types. Have added it into package.json explicitly. Now it works.

0reactions
github-actions[bot]commented, May 11, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring Jest
Configuring Jest. The Jest philosophy is to work great by default, but sometimes you just need more configuration power.
Read more >
jest/normalize.ts at main · facebook/jest - GitHub
// so oldOptions[key] is the only way it should be used. const oldOptions = options as Config.InitialOptions &.
Read more >
Diagnostics option | ts-jest - GitHub Pages
Each config. key is optional: warnOnly : If specified and true , diagnostics will be reported but won't stop compilation (default: disabled) ...
Read more >
@jest/types Config TypeScript Examples - ProgramCreek.com
This page shows TypeScript code examples of @jest/types Config. ... Config.InitialOptions = { verbose: true, preset: 'ts-jest', testEnvironment: 'jsdom', ...
Read more >
How to configure typescript with ts-jest and ts-node with rootDir
You have to specify the ts-node config in tsconfig.json. // tconfig.json { "compilerOptions": { "rootDir": "src", .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found