Giter Club home page Giter Club logo

mdn / advanced-js-fundamentals-ck Goto Github PK

View Code? Open in Web Editor NEW
81.0 18.0 100.0 323 KB

This content kit provides learning material to allow intermediate web developers to level up their skills, learning real world techniques to take them past rudimentary syntax towards a solid foundation of skills than can be utilized to create modern web applications. It'll be visual; you'll have fun along the way.

License: Mozilla Public License 2.0

CSS 1.55% HTML 4.17% JavaScript 94.28%

advanced-js-fundamentals-ck's Introduction

Advanced JavaScript fundamentals content kit

Very much in draft right now.

This is the Advanced JavaScript Fundamentals Content Kit. It contains everything you need to present/teach several lessons on advanced Js techniques.

To get started, visit This project's index file..

You can get much more detailed instructions on writing a content kit from our Making a new content kit guide.


Testing

Mocha is used for testing each of the tutorial sections. If you don't have mocha installed, run the command npm install -g mocha.

Chai is an assertion library. We are using it to write the tests in an expect format. To install chai for this repo, run

npm install

You should now be able to run npm test from the main directory and see the failing and pending tests.

Each folder in tutorials has a test folder. You can run tests for a specific tutorial section by changing into that directory and running mocha. For example,

cd tutorials/02-functions
mocha

Some of the files to write your answers have already been created, but are not yet properly filled out to pass the tests. For example,

tutorials/02-functions/01-calling-functions.js

Is where you should write your answers to the test file

tutorials/02-functions/test/01-calling-functions-test.js

And includes the work to be completed from

tutorials/02-functions/01-calling-functions.md

Contributing

Not all of the tutorial tests have been written. All of the tutorials that are currently tested will have a corresponding js file named similarly to the md file, as noted above. If you would like to add a test and starter file of your own for one of the topics, please do the following:

Fork the repo and create a new branch with the name of the tutorial section you will be contributing to.

git checkout -b calling-functions

Create the corresponding test and start files for that tutorial, making sure to use kebab-case rather than snake_case for the file names.

touch tutorials/02-functions/01-calling-functions.js
touch tutorials/02-functions/test/01-calling-functions-test.js

Don't forget to also add these new files as <script> tags in the tutorial's index.html file, located in each tutorial folder.

<script src="01-calling-functions.js"></script>

<script src="test/01-calling-functions-test.js"></script>

Include the necessary setup variables in the starter file to at least make your tests fail with a message rather than producing an error.

function doubleNumber(number) {
}

var timesTwo;

if (typeof window === 'undefined') {
  module.exports = timesTwo;
  module.exports = doubleNumber;
}

And then of course write your tests in the test file.

if (typeof window === 'undefined') {
  var expect = require('chai').expect;
  var doubleNumber = require('../01-calling-functions.js');
  var timesTwo = require ('../01-calling-functions.js');
}

describe('Calling functions', function () {
  ...
});

Please note the if (typeof window === 'undefined') statement in both of these files. The statement surrounds the module.exports portion of the starter file and the require statements of the test file. The reason for this if statement is to ensure that the mocha tests will run both from the command line and in the browser, depending on the user's preference.

Once you have completed your tests, commit your code to your branch and create a pull-request.

Please leave an issue if you have any questions or would like help contributing to this repository.

advanced-js-fundamentals-ck's People

Contributors

androidgrl avatar chrisdavidmills avatar hhoopes avatar imwithsam avatar joshcheek avatar levthedev avatar marlabrizel avatar mitcha16 avatar mowalon avatar mozilla-github-standards avatar mrjaimisra avatar nydrewreynolds avatar stevekinney avatar tleskin avatar tmee avatar toriejw avatar willklein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.