-
-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Karma configuration from Angular plugin configuration #885
Conversation
commit: |
|
||
export type ConfigFile = (config: Config) => void; | ||
export const loadConfig = (configFile: ConfigFile): ConfigOptions | undefined => { | ||
if (typeof configFile !== 'function') return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this in order to allow empty configuration files for test fixtures
['karma-jasmine', 'karma-chrome-launcher', 'karma-jasmine-html-reporter', 'karma-coverage'], | ||
options.manifest.devDependencies | ||
) | ||
.forEach(inputs.add, inputs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't like the .forEach(inputs.add, inputs)
. But doesn't work without the latest inputs
argument to specify this
. And a for loop (as forEach
is forbidden by Biome linter) looks too much 🤷 happy to change if someone else is unhappy too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, this is fine really
6161030
to
ba45938
Compare
Great, plugins use each other all over the place and it's chaotic and beautiful :) |
🚀 This pull request is included in v5.42.0. See Release 5.42.0 for release notes. Using Knip in a commercial project? Please consider becoming a sponsor. |
Angular allows running tests using Karma via the
@angular-devkit/build_angular:karma
builder. However, configuration in Angular CLI workspace (akaangular.json
) using that builder to run tests using Karma isn't taken into account as Karma configuration. But this is something that comes built-in when creating a fresh Angular project. This PR aims to take into account that builder configuration forknip
.To do so:
helpers.ts
. In the same fashion that XO uses some ESLint helpers. The code to load a configuration file has been moved there too to keep clean theindex.ts
file.karmaConfig
in builder options is used to: