Code Monkey home page Code Monkey logo

refactoru-client9's Introduction

CLIENT9: Test Drive 101

Objective

Implement a pure splice function using test-driven development.

Resources

(Needed for Part II)

Requirements

Part I
  1. Download or clone the test-drive-101 files from the exercise-starters repo.
  2. Open test-runner.html in your browser. Open the dev tools console. See the errors that say FAIL? Congratulations, you're already through the "red" phase of test-drive development!
  3. Open spec.js in your editor. Implement the splice method so the accompanying tests all pass. You are not allowed to use the built-in splice method in your function; you are reproducing its functionality from scratch in a functional style.
Tip: Look over the included assert functions which serve as a barebones testing framework. Look over the
unit tests at the end (where assert is called) to see the kinds of things that are being tested for. You
will get to write your own unit tests soon!

Part II

  1. Read the How Do I Jasmine tutorial.
  2. Clone or download the jasmine boilerplate from the student-sample-code repo. Save this into the local repo you will be submitting for this exercise.
  3. Copy your splice function into a new javascript file and modify SpecRunner.html to include it.
  4. Open SpecRunner.html in your browser to see the initial (failing) test suite being invoked.
  5. Rewrite the unit tests from Part I using Jasmine-style unit tests. Write these in spec/my-spec.js which is already being included by SpecRunner.html. Make sure that the tests all pass, and that they cover all the cases originally covered in Part I.
Warning: There are a lot of files being download, saved, and included in this exercise. If something fails
to work or it seems like a file is not included correctly, use this opportunity to practice your debugging
skills and see if you can trace the problem. What might be causing it? How can you test your assumptions?
What basic functionality can you make sure is working?

refactoru-client9's People

Contributors

mortonfox avatar

Watchers

James Cloos avatar Debra Zapata avatar

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.