Quantcast
Channel: User user2297996 - Stack Overflow
Browsing all 37 articles
Browse latest View live
↧

Comment by user2297996 on How to create a type in TypeScript which can be a...

Or we can test if y has a constructor, if it then it's the class. etc.

View Article


Comment by user2297996 on How to run a single test suite in Jest?

Yeah I know all that. The question is how can I run only a single test or test suite without the CLI? You can do this with Mocha / Chai / Sinon for example, I'm just wondering if this is also possible...

View Article

Comment by user2297996 on What's the performance impact of consuming...

We would read those configs on every request. Otherwise we couldn't use updates kubernetes provides via autoupdate, since we would only get the initial config.

View Article

Comment by user2297996 on How to populate GTK4 DropDown using a custom struct?

I'm not saying StringListModel is the only supported one, but it's the only one supported automatically. So what I need is a custom "class" which implements the ListModel interface. This seems to...

View Article

Comment by user2297996 on Is it possible to to handle invalid JSON values...

No. I want to convert every type that's not boolean to false.

View Article


Comment by user2297996 on Is it possible to to handle invalid JSON values...

Thanks. This sounds much better than implementing From for each and every struct / enum. But I guess this still means I have to create a bunch of custom deserializers and then attach them to each field...

View Article

Comment by user2297996 on How to create a generic function that supports...

OK I see thc. Just want to know if there is an easy way around this, but apparently there isn't. Anyway thx!

View Article

Comment by user2297996 on How to implement a trait in Rust which modifies a...

@ShadowRanger yes, but I was hoping for a simpler solution :) Anyway thanks, i will look into this answer.

View Article


Comment by user2297996 on How to get all items from a GtkComboBoxText in GTK4...

@JMAA I know it's deprecated but my app supports it. Moreover, setting the active-id doesn't seem to wok. At least, it doesn't work with the string value of the option. And get_active_id() returns None...

View Article


Can I fix TypeScript imports to use only @ns/pkg instead of @ns/pkg/subdir/xy...

I have imports like this:import { some } from '@namespace/pkg/some/other';The package has proper index file now, so I want to change all imports to:import { some } from '@namespace/pkg';There are many...

View Article

Answer by user2297996 for How to put a spy to a single function using SinonJS?

Just to clarify:In order to be able to use Sinon spies, you need to export your module functionality in a certain way. Basically, use classes or objects.Works:export default {func() {},func2()...

View Article

How to put a spy to a single function using SinonJS?

I have this:import * as sinon from 'sinon';import {someFunc, someOtherFunc} from 'someModule';describe("Something", () => { let sandbox: sinon.SinonSandbox; beforeEach('setup sandbox', function() {...

View Article

Istanbuljs with TS reports 0% coverage for certain files only. Why?

So I have this config:.nycrc"extends": "@istanbuljs/nyc-config-typescript","extension": [".ts" ],"exclude": ["**/*.d.ts","**/*.spec.ts" ],"reporter": ["html","lcov","text-summary" ],"lines":...

View Article


NodeJS EventEmitter: how to wait for all events to finish?

Got a class, it extends EventEmitter.Got function that fires a bunch of events on that emitter. These events trigger async tasks and they all have a done() callback.What's the proper way to wait for...

View Article

How to run a single test suite in Jest?

I have many test suites. I wanna to run a singe one and skip all the others, and I would like to do this on the code level.I know I can do this using .only() and .skip() in a test file, but that...

View Article


How to resolve Eslint plugin ambiguity?

I have a eslint config which extends some others. Those packages depend on "@typescript/eslint-plugin" but they use different versions. extends: ['airbnb', 'airbnb-typescript',...

View Article

Does the Nestjs controller method have to be async if it returns a promise?

Very simple general question:@Controller('something')class SomeController { @Get() foobar() { return foo() // this returns a promise }}So in such a case, do I have to make the foobar() controller...

View Article


Answer by user2297996 for How to delete / skip directory using Angular...

Figured it out:There is no such option, but you don't need it. If you don't want a directory to be created, remove its contents from the tree using tree.delete(). Schematics won't create empty...

View Article

How to delete / skip directory using Angular schematics?

I have some files in my schematics template which should be generated only when a certain input options is present. e.g: db==trueIs there a way to skip these directories / files?One solution is to...

View Article

Answer by user2297996 for How to validate plain object with class-validator?

This cannot be done using just JSON. You have to create a class type and use that as follows:@IsBoolean()someBool: boolean@IsString()someStr: string@ValidateNested()@Type(() => SomeClass)someObject:...

View Article
Browsing all 37 articles
Browse latest View live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>