Category "typescript"

Jest finds tests but doesn't collect coverage

I trying to collect test coverage for this project using yarn test --coverage # i.e. "react-scripts test --coverage" My jest config is this: "jest": {

TS2339: Property 'comparePassword' does not exist on type 'Model<Document, {}>'

I have defined a schema method by using this code. While I use in the service. It is showing a error. // model export interface User extends mongoose.Document

"React has detected a change in the order of Hooks" but Hooks seem to be invoked in order

I am trying to use Context and Reducers via React's hooks, and running into problems with the order of the hooks not being constant. My understanding was that a

Argument of type 'string | null' is not assignable to parameter of type 'string'. Type 'null' is not assignable to type 'string'

I have a dotnetcore 20 and angular4 project that I am trying to create a userService and get the user to my home component. The backend works just fine but the

Why property does not exist on type in rxjs pipe function?

Why I losing the type in my pipe function? How to fix that? Property 'n' does not exist on type '{}' stackblitz import { of, map, Observable, Subject, pipe, t

'React' refers to a UMD global, but the current file is a module

I updated my project to create react app 4.0, and I'm slowing moving over my files to TypeScript. I know with this new version you don't have to repetitively im

'React' refers to a UMD global, but the current file is a module

I updated my project to create react app 4.0, and I'm slowing moving over my files to TypeScript. I know with this new version you don't have to repetitively im

Typescript compiler error for property that exists

I am using a React package called react-canvas-draw(https://github.com/embiem/react-canvas-draw) and the main class CanvasDraw has a function called getDataURL.

Mock OpenSearch Client in jest unit test

I'm trying to mock out the opensearch client for testing purposes and am running into an error. My app is using OpenSearch (@opensearch-project/opensearch) and

AngularFIre: LImit to 10 most recents registers

I have a query on firebase, but I want to show just the most 10 recents registers instead all of them my code is: videos: Observable<any[]>; construc

Usage of WebView in Typescript template of react native

I am trying to use WebView in the react native boilerplate (template: typescript). I am using WebView from react-native-webview library. /** * Sample React

Angular HttpClient "Http failure during parsing"

I try to send an POST request from Angular 4 to my Laravel backend. My LoginService has this method: login(email: string, password: string) { return this.

eslint complains about typescript's path aliasing

I've set up path aliasing in typescript's .tsconfig so my imports look cleaner. In my code when I try and import my interface like this import { ApiResponse }

Type {} is missing the following properties from type {}: length, pop, push, concat, and 29 more

const function= () => { facets = useSearchMoreFacets( variables ); }; type UseSearchMoreFacets = { facets: MappedFacet[] | undefined; };

Create Command-line Launcher Intellij not found

I would like to use idea pom.xml from command line to launch a simple Maven project, and so I think I need to configure using "Create Command-line Launcher"

Setting for more strict validation on interface methods

We are running a monorepo and have contracts with one interface of methods that takes a request and returns a Promise<Response>. One interface example is

React component type in TypeScript

What is the correct way to describe the type of a react component in TypeScript? Say we have a function which returns a react component. The function: const ge

Creating a (.NET 6 based) website project with ASP.NET Core and React (TypeScript) in Visual Studio 2022?

I have been trying to set up an ASP.NET Core + React (TypeScript) web app project in Visual Studio 2022, but couldn't succeed in doing so. There are no proper s

How do i set the active tab in PrimeNG tabMenu?

Where I do declare activeIndex and how to use this variable ? I have html file: <p-tabMenu [model]="tabMenuItems"></p-tabMenu> and typescript f

How to remove the previously selected option from a drop-down menu in a table?

I am making a project on angular 7.It has a table with a column having dropdowns. The dropdown contains various languages. When a language is selected in a part