so the thing is. I am building an Angular Test Explorer. I am able to see all the tests and run them all together by using the karma module like this:
public async runWithModule(): Promise<void> {
return new Promise<void>(resolve => {
karma.runner.run({ port: 9876 }, (exitCode: number) => {
global.console.log("karma run done with ", exitCode);
resolve();
});
});
}
I am also able to run specific set of tests creating a shell and passing --grep
const command = `karma run -- --grep="${tests}"`;
const exec = require("child_process").exec;
exec(command, {
cwd: this.angularProjectRootPath + "/node_modules/karma/bin/",
});
unfortunately the method for running a set of tests works different depending on the OS as the shell its different. This is giving me some problems.
I was wondering if anybody cant point me out how is that angular cli is doing karma run and specifying a set of tests when you do a regular ng test.
I asked in the karma repository and support without any answer so that's why I am asking here, I also tried finding that part of the code in the repository of the angular devkit. I have found where they do the karma.server but could not find the part I need.