Skip to content

fix: validate test init before executing the test command #4381

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

Merged
merged 2 commits into from
Feb 25, 2019

Conversation

DimitarTachev
Copy link
Contributor

PR Checklist

Related to: #4373

@ghost ghost assigned DimitarTachev Feb 22, 2019
@ghost ghost added the new PR label Feb 22, 2019
@DimitarTachev
Copy link
Contributor Author

run ci

name: 'karma',
// Hardcode the version unitl https://github.com/karma-runner/karma/issues/3052 is fixed
version: "2.0.2"
name: 'karma'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just update the version. It will be bad if a new karma version breaks our functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

protected $options: IOptions,
protected $platformEnvironmentRequirements: IPlatformEnvironmentRequirements,
protected $errors: IErrors) {
super("android");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use "protected abstract" in parent class and just set in derived classes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using constant for the platform will be good improvement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -159,7 +160,7 @@ export class Errors implements IErrors {
} catch (ex) {
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this probably will affect Sidekick/KinveyStudio but I'm not sure what exactly will be the impact.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to split the conditions in two separate lines for readability of the code.

@DimitarTachev DimitarTachev merged commit 90ba02c into release Feb 25, 2019
@ghost ghost removed the new PR label Feb 25, 2019
@DimitarTachev DimitarTachev deleted the tachev/validate-test branch February 25, 2019 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants