Code Monkey home page Code Monkey logo

webtesting-i-challenge's Introduction

Unit Testing Module Project

Instroduction

In this project, you will write unit tests and the implementation code for a module that helps players see the results of a success or failure when trying to enhance their in-game items. The requirements are listed under the Minimum Viable Product section below.

Instructions

Task 1: Set Up The Project With Git

Follow these steps to set up and work on your project:

  • Create a forked copy of this project.
  • Clone your OWN version of the repository (Not Lambda's by mistake!).
  • Create a new branch: git checkout -b <firstName-lastName>.
  • Implement the project on your newly created <firstName-lastName> branch, committing changes regularly.
  • Push commits: git push -u origin <firstName-lastName>.

Task 2: Minimum Viable Product

After a set of interviews with the potential users of the solution, we gathered the following information about the functionality of the game's enhancing system. Your job is to add tests to ./enhancing/enhancer.spec.js and code to ./enhancing/enhancer.js to implement the requirements; ./enhancing/enhancer.js exports an object that has the following methods:

  • a repair(item) method that accepts an item object and returns a new item with the durability restored to 100. This method is the simplest of the three and would be a good starting point on this project.
  • a success(item) method that accepts an item object and returns a new item object modified according to the rules defined by the client for enhancement success.
  • a fail(item) method that accepts an item object and returns a new item object modified according to the rules defined by the client for enhancement failure.
  • a get() method for use when working on the stretch problem.

The following sections list information provided by the client about items and the game's enhancing system.

Items

  • Items have name, durability and enhancement.
  • The item's enhancement it's a number from 0 to 20.
  • The item's durability it's a number from 0 to 100.

When enhancement succeeds

  • The item's enhancement increases by 1.
  • If the item enhancement level is 20, the enhancement level is not changed.
  • The durability of the item is not changed.

When enhancement fails

  • If the item's enhancement is less than 15, the durability of the item is decreased by 5.
  • If the item's enhancement is 15 or more, the durability of the item is decreased by 10.
  • If the item's enhancement level is greater than 16, the enhancement level decreases by 1 (17 goes down to 16, 18 goes down to 17).

Task 3: Stretch Goals

This section is optional and not counted towards MVP. Start working on it after you're done with the main assignment.

  • Add a get() method to the enhancer object that takes an item and returns a new item with the name property modified according to the following rules:
    • if the enhancement level is 0, the the name is not modified.
    • if the enhancement level is greater than 0, change the name to include the enhancement level, preceded by a plus sign ( + ), between square brackets before the item's name. Example: the name of a "Iron Sword" enhanced to 7 would be "[+7] Iron Sword".
  • Design and build a Web Application to test the enhancing module you implemented for the MVP.
  • Work on this repository for extra practice testing JavaScript Functions.

Submission format

Follow these steps for completing your project.

  • Submit a pull request to merge <firstName-lastName> Branch into master (student's Repo). Please don't merge your own pull request

webtesting-i-challenge's People

Contributors

dryanmas avatar ladrillo avatar luishrd avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

webtesting-i-challenge's Issues

succeed() in enancer.js vs. success() in README

Hi there!

I found the switch between using succeed and success to refer to the same function a bit confusing. I'd recommend either deleting the empty functions in the enhancer.js file and having the student write them all entirely from scratch, or changing succeed() in enhancer.js to success() to match the README to help students move along a bit more smoothly.

Thanks!
Kimberlee

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.