question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add tests to check randomMissionsCompleted() returns an object with keys missionsCompleted and missionsCompleted7Days

See original GitHub issue

first-timers-only

This issue is tagged :octocat: first-timers-only. It is only for people who have never contributed to open source before, and are looking for an easy way take their first steps.

Consider this your chance to dip your toe into the world of open-source, and get some bragging rights for writing code that makes drones fly, lets cars find charging stations, helps people and goods get from place to place, and more.

Find more first-timers-only issues here:

Thank you for your help ❤️

What is this project?

DAV (Decentralized Autonomous Vehicles) is a new foundation working to build an open-source infrastructure for autonomous vehicles (cars, drones, trucks, robots, and all the service providers around them) to communicate and transact with each other over blockchain.

As an organization that believes in building a large community of open-source contributors, we often create issues like this one to help people take their first few steps into the world of open source.

Mission Control

The DAV project you are looking at is Mission Control. It is the brain in charge of orchestrating missions between DAV users and autonomous vehicles.

How you can help

Background

To help developers building on top of DAV technologies, Mission Control can start in a simulation environment. In a simulation environment, there are always a few simulated drones flying around the user, ready to take on missions. This makes it easy for developers to start building and testing without investing in hardware.

The Issue

As a project that relies on a large community of contributors, it is very important for us to have good tests to make sure changes don’t break anything.

One of the functions that need testing is randomMissionsCompleted() inside /server/simulation/random.js that creates random number of missionsCompleted and missionsCompleted7Days.

The task for this issue is to test the functions return value to have the following keys

  • missionsCompleted and
  • missionsCompleted7Days

Edit test/specs/simulation.random.spec.js, adding a describe block for randomMissionsCompleted() if it does not exists and within it two tests that verify the conditions mentioned above.

To run your tests, run npm test from the project’s root directory. All tests should pass.

tests

Contributing to Mission Control

  • Fork the repository from the Mission Control GitHub page.
  • Clone a copy to your local machine with $ git clone git@github.com:YOUR-GITHUB-USER-NAME/missioncontrol.git
  • Make sure you have node.js and npm installed on your machine. You can use this guide for help.
  • Install all of the project’s dependencies with npm. $ cd missioncontrol; npm install
  • Run npm test to run linting checks and all the automated tests and see that they pass.
  • Code! code! code!
  • Before committing your code, run npm test one last time and make sure no errors (including linting errors) are thrown.
  • Once you’ve made sure all your changes work correctly and committed all your changes, push your local changes back to github with $ git push -u origin master
  • Visit your fork on GitHub.com (https://github.com/YOUR-USER-NAME/missioncontrol) and create a pull request for your changes.
  • Make sure your pull request describes exactly what you changed and references this issue (include the issue number in the title like this: #28)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Sep 25, 2017

Hi, I am extremely sorry for the very late response. I have been really busy and been travelling around for work. I have completed the task, and will send a pull request as soon as I settle back, which is in a couple of days. Again, I am really sorry for the delay.

0reactions
TalAtercommented, Sep 12, 2017

@debeshadhikari how is it going with this one? Do you need any help?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit test controller logic in ASP.NET Core - Microsoft Learn
The Verifiable method call is checked by executing mockRepo.Verify() in the assertions. Two Idea objects are returned for the session. The last ...
Read more >
unittest — Unit testing framework — Python 3.11.1 ...
This naming convention informs the test runner about which methods represent tests. The crux of each test is a call to assertEqual() to...
Read more >
Testing Kotlin flows on Android
If the test needs to check multiple values, calling toList() causes the flow to wait for the source to emit all its values...
Read more >
Java Unit Testing with JUnit and TestNG
Unit Testing is concerned about testing individual programs/classes to ascertain that each program/class runs as per specification. Prior to the arrival of " ......
Read more >
How To Test a React App with Jest and React Testing Library
The testing file prepared for the doggy-directory sample project is set up with minimal code before you add testing paradigms.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found