Categories
Mastering Development

Property ‘toBeInTheDocument’ does not exist on type ‘Matchers

Trying to setup testing for a components library. I’ve tried many example and all similar threads on this with no luck. My setupTests.ts file is correctly being loaded (proven with a console.log), and the library seems to be available as if I add import { toBeInTheDocument } from ‘@testing-library/jest-dom/matchers’ and log toBeInTheDocument it is present. […]

Categories
Mastering Development

What’s wrong with my importing path & clicking to open file?

I just started a new job, and therefore a new setup. It’s not all that different but for some reason I am having 2 problems related to what the import path shows, and clicking on files/components to open the file do not work. Could this be because of the jsconfig file?: { “compilerOptions”: { “checkJs”: […]

Categories
Development

tsconfig “paths” are compiled and included by tsc? How can you stop this?

Imagine the following project structure /src index.ts a.ts /external external.ts When using the following tsconfig.json: { “compilerOptions”: { “outDir”: “dist”, “declarationDir”: “dist”, “declaration”: true, “baseUrl”: “./src”, “paths”: { “@external/*”: “../external/*” } }, “exclude”: [ “dist” ] } The output will contain the external package /dist /src a.d.ts a.js index.d.ts index.js /external external.d.ts external.js When what […]

Categories
Development

Why create-react-app alias is not able to find index.js from folder?

I am stuck up with a weird issue while creating alias for my app. I am trying to create the alias adding jsconfig.json what looks like { “compilerOptions”: { “lib”: [ “dom”, “es2015”, “es2016”, “es6”, “es2017” ], “target”: “es2017”, “module”: “es6”, “allowSyntheticDefaultImports”: true, “baseUrl”: “./”, “paths”: { “actions/*”: [“src/actions/*”], “public/*”: [“public/*”], “components/*”: [“src/components/*”], “containers/*”: [“src/containers/*”], […]

Categories
Development

WebStorm breakpoints issue with TypeScript React App (using webpack)

I tried to configure the JavaScript Debugger as the WebStorm website is telling so: https://blog.jetbrains.com/webstorm/2017/01/debugging-react-apps/ However, it worked like for 2 minutes and it doesn’t work anymore, I can’t tell why.. Is it at least stable with TypeScript? Can I use the JavaScript Debugger? Edit 1 (based on @lena comment) Here you can find my […]