Categories
Linux Mastering Development

Can’t filter file extensions when the list is in a variable [duplicate]

I guess this is a relative simple question, but I can’t find the way to access the variable content when doing a git diff, so it lists all the files with specific extension. // This works fine git diff –name-only –cached –diff-filter=d *.{sln,csproj,vbproj,vcxprojfilters,proj,projitems,shproj,xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct,json,json5,webmanifest,yml,yaml,md,htm,html,js,jsm,ts,tsx,css,sass,scss,less,svg,vue,cmd,bat,sh,Makefile,cs,csx,cake,vb,vbx,cs,csx,cake,cs,csx,cake,vb,vb} MyProyect/Service/App/AppGridService.cs // but this does not work // this is the variable […]

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

Cannot manage to get Jest working with reactjs

I’m getting the following errors when trying to run npm run test. npm : FAIL src/App.test.js At line:1 char:1 + npm run test + ~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (FAIL src/App.test.js:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError ÔùÅ Test suite failed to run Cannot find module ‘react’ from ‘iconBase.js’ However, Jest was able to find: […]

Categories
Mastering Development

Grabbing result from a picker view for use in other view controller

Hello fellow programmers, I am having some trouble figuring out passing data between view controllers. my initial view controller(SelectCarViewController) consists of two pickers(year and make/model) I have a Label that displays the year once selected and a label that displays the make/model once selected. Once the two are filled in an invisible button(search parts) will […]

Categories
Mastering Development

Cannot read property ‘fromJSON’ of undefined while testing in Jest

while running jest i get the following error.I dont know why am i getting this error. TypeError: Cannot read property ‘fromJSON’ of undefined at Object. (node_modules/@grpc/proto-loader/node_modules/protobufjs/ext/descriptor/index.js:3:66) at Object. (node_modules/@grpc/proto-loader/build/src/index.js:23:20) Below is the tsconfig.json { “compilerOptions”: { “target”: “esnext”, “module”: “commonjs”, “outDir”: “dist”, “sourceMap”: true, “moduleResolution”: “node”, “declaration”: true, “experimentalDecorators”: true, “allowSyntheticDefaultImports”: true, /* Allow default […]

Categories
Mastering Development

How to test react navigation authentication flow?

I’m developing a React Native application. I’m doing something like what’s explained here to implement the authentication flow. So, I created an AppContainer that looks like this: import {createAppContainer, createSwitchNavigator, createStackNavigator} from “react-navigation”; import AuthLoadingScreen from “../screens/auth/auth-loading-screen”; const AppStack = createStackNavigator({ Home: {screen: HomeScreen} }); const AuthStack = createStackNavigator({ SignIn: {screen: SignInScreen} }); const AppContainer […]

Categories
Development

Babel-node ignores or misbehaves when I add ignore option to babel.config.js

am using the command npx babel-node –ignore=’ ‘ –extensions=’.ts,.tsx,.js,.jsx,.es6,.es’ test.js to compile the script named test.js . test.js imports import template from ‘lodash-es/template’; and I would like it to be compiled too. Adding ignore or include or exclude options regex at babel.config.js doesn’t work. How do i add an inline –ignore option ({ ignore: [/node_modules\/(?!lodash-es)/] […]

Categories
Development

How to distribute package for expo? (.web.js, .js configuration)

I want to distribute a package for expo. This package was created while building my app in expo SDK36. Like many expo dependencies, I use massively the .ios.js, .android.js and .web.js extensions. While importing a source I have distributed on npm, resolver only import .js without any distinction. As an example this package should work […]

Categories
Development

Eslint not working with the TypeScript syntax

I am trying to configure eslint for my REACT-TypeScript project. It was previously using tslint which is going to deprecate soon. I have gone through the web and finally was able to create my .eslintrc.json: { “parser”: “@typescript-eslint/parser”, “parserOptions”: { “ecmaFeatures”: { “jsx”: true }, “project”: “./tsconfig.json”, “ecmaVersion”: 2018, “sourceType”: “module” }, “env”: { “browser”: […]