fix: validate test init before executing the test command#4381
Conversation
|
run ci |
| name: 'karma', | ||
| // Hardcode the version unitl https://github.com/karma-runner/karma/issues/3052 is fixed | ||
| version: "2.0.2" | ||
| name: 'karma' |
There was a problem hiding this comment.
Maybe just update the version. It will be bad if a new karma version breaks our functionality.
| protected $options: IOptions, | ||
| protected $platformEnvironmentRequirements: IPlatformEnvironmentRequirements, | ||
| protected $errors: IErrors) { | ||
| super("android"); |
There was a problem hiding this comment.
Maybe use "protected abstract" in parent class and just set in derived classes.
There was a problem hiding this comment.
Using constant for the platform will be good improvement.
| if (!canStartKarmaServer) { | ||
| this.$errors.fail({ | ||
| formatStr: "Error: In order to run unit tests, your project must already be configured by running $ tns test init.", | ||
| suppressCommandHelp: true, |
There was a problem hiding this comment.
Maybe we can create better user experience by prompt the user to automatically execute tns test init command.
This is not a merge stopper and can be done in another PR if we decide it is appropriate.
| const loggerLevel: string = $injector.resolve("logger").getLevel().toUpperCase(); | ||
| const printCallStack = this.printCallStack || loggerLevel === "TRACE" || loggerLevel === "DEBUG"; | ||
| const message = printCallStack ? resolveCallStack(ex) : `\x1B[31;1m${ex.message}\x1B[0m`; | ||
| const message = printCallStack ? resolveCallStack(ex) : isInteractive() ? `\x1B[31;1m${ex.message}\x1B[0m` : ex.message; |
There was a problem hiding this comment.
It seems this probably will affect Sidekick/KinveyStudio but I'm not sure what exactly will be the impact.
There was a problem hiding this comment.
It might be better to split the conditions in two separate lines for readability of the code.
c7a8221 to
c5a8767
Compare
PR Checklist
Related to: #4373