GithubHelp home page GithubHelp logo

jasmine-frame's Introduction

Introduction into Unit Testing With Jasmine

Setup:

  1. In your terminal, run npm install -g jasmine to install jasmine globally
  2. Fork/clone this Repo.
  3. cd into the src folder.
  4. cd into the 01_addition folder.
  5. run jasmine init to create the jasmine spec folders.
  • We will look and see what this is doing soon.
  1. In your terminal, run touch testing_addition.spec.js
  • We will look and see how the .spec file tag is being read soon.
  1. Open your text editor
  • (if using atom) in your terminal run atom .

Exercises:

The Objective of these exercises is to Learn how to write Tests using TDD in the Jasmine Test-Framework.

A basic knowledge of JavaScript functions will make the process of learning how to test easier.

#1 Addition:

Create a function that takes 2 arguments, the function should return the value of those 2 arguments added together

#2 Subtraction:

Create a function that takes 2 arguments, the function should return the value of those 2 arguments subtracted from each other

#3 Multiplication:

Create a function that takes 2 arguments, the function should return the value of those 2 arguments multiplied with each other.

#4 Is_Divisible:

Create a function that takes 2 arguments, the function should return the value of the arguments Divided by the other.

#5 Hello_World:

Create a function that takes an argument

  • It should return a string of "Hello, World!" if the argument is empty.
  • It should return a string of "Hello, ${argument}!" if the argument is a string.

#6 FizzBuzz:

Create a function that takes an argument

  • The function should return "Fizz" if the argument is divisible by 3.
  • The function should return "Buzz" if the argument is divisible by 5.
  • The function should return "Buzz" if the argument is divisible by both 3 AND 5

jasmine-frame's People

Contributors

isaacjcollier avatar tommygaessler avatar

Watchers

 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.