Code Monkey home page Code Monkey logo

fizz_buzz_js's Introduction

JS Test Boilerplate 0.1 (WIP)

Build Status Coverage Status

####Dependencies

####Services

####Set up Fork or download this repo (using git clone) and modify the files to suite your testing needs.

You can also use SVN to download this repo to your new project folder. On OSX you can install SVN using Homebrew.

$ brew install subversion

Create a new folder and cd into it. Run the svn export command to download files.

$ svn export https://github.com/CraftAcademy/karma-jquery-jasmine_boilerplate/trunk . --force

Once downloaded, you need to install all dependencies. Run

$ npm install

####Usage You can use this setup to test your units and your jQuery events. Place your JavaScript code in assets/js/ folder and partials in spec/fixtures/ folder.

Your specs need to be end with _spec.js (e.g. fizz_buzz_spec.js)

Run tests with

$ npm test

# or

$ karma start karma.conf.js

####Adding tests I have included some basic specs and js code for you to examine. Basically you need to build up your test environment and tear it down afterwards. You can have different setups by nesting your describe blocks/functions.

# spec/my_spec.js
describe("Given my code", function () {

	beforeEach(function () {
		/* ... Set up your test ... */
	});

	afterEach(function () {
		/* ... Tear it down ... */
	});

	describe("When ...", function () {

		beforeEach(function () {
		  /* ... Context specific setup ... */
		});

		it("Then...", function () {
			expect(true).toEqual(true);
		});
	});
});

fizz_buzz_js's People

Contributors

aniansson avatar

fizz_buzz_js's Issues

Code review

@blondabambi Good work overall with this challenge. There are a couple of things I would like to point out:

  • You need to update the README.md of your repository to actually describe what the project is all about.
  • Get rid of files that come from the boilerplates we provide if you don't need them. e.g (assets/js/sample_object.js)
  • Remove all debugger instructions from the code once you're done. There's one in spec/fizz_buzz_ui_spec.js
  • Can you re-write the logic of the fizzBuzzChallenge() function using case statements?

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.