Skip to content
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

Support running single test files with npx mocha - Closes #2930 #2931

Merged
merged 1 commit into from Feb 22, 2019

Conversation

Projects
3 participants
@yatki
Copy link
Member

commented Feb 21, 2019

What was the problem?

We were not able to run mocha tests with npx mocha <file> command.

How did I fix it?

I created a symlink for mocha.opts file under test/mocha.opts so mocha can read the options by default.

How to test it?

Run:

npx mocha framework/test/mocha/unit/components/cache/cache.js

Review checklist

  • The PR resolves #2930
  • All new code is covered with unit tests
  • All new code was formatted with Prettier
  • Linting passes
  • Tests pass
  • Commit messages follow the commit guidelines
  • Documentation has been added/updated

@yatki yatki self-assigned this Feb 21, 2019

@yatki yatki requested a review from nazarhussain Feb 21, 2019

@@ -0,0 +1 @@
../framework/test/mocha/mocha.opts

This comment has been minimized.

Copy link
@nazarhussain

nazarhussain Feb 21, 2019

Contributor

Does it work with IDEs e.g. Webstorm? What to do when root test directory will have its own test files?

This comment has been minimized.

Copy link
@yatki

yatki Feb 21, 2019

Author Member

Please checkout the branch and try it with your IDE. I don't have it installed. Also, I think IDE related configuration shouldn't be application configuration's concern.

When the root project have its own tests, they would conflict with the current framework tests anyway. I think we can come up with a solution then.

This comment has been minimized.

Copy link
@nazarhussain

nazarhussain Feb 21, 2019

Contributor

I tried, its working with Webstorm.

This comment has been minimized.

Copy link
@nazarhussain

nazarhussain Feb 21, 2019

Contributor

@yatki The point is not far to introduce root level tests for the application implementation. So start thinking of the solution to this problem.

@yatki yatki requested a review from nazarhussain Feb 21, 2019

@MaciejBaj MaciejBaj added this to In progress in Version 1.6.0 via automation Feb 22, 2019

@MaciejBaj MaciejBaj merged commit 417e47f into development Feb 22, 2019

3 checks passed

jenkins-ci/lisk-core This commit looks good
Details
jenkins-ci/lisk-core-network This commit looks good
Details
security/snyk - package.json (LiskHQ) No manifest changes detected

Version 1.6.0 automation moved this from In progress to Closed PRs Feb 22, 2019

@MaciejBaj MaciejBaj deleted the 2930-support-npx-mocha branch Feb 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.