↧
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 ArticleComment 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 ArticleComment 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 ArticleComment 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 ArticleComment 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 ArticleComment 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 ArticleComment 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 ArticleComment 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 ArticleComment 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 ArticleCan 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 ArticleAnswer 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 ArticleHow 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 ArticleIstanbuljs 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 ArticleNodeJS 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 ArticleHow 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 ArticleHow 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 ArticleDoes 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 ArticleAnswer 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 ArticleHow 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 ArticleAnswer 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
More Pages to Explore .....