Yarn, Webpack 1, TypeScript 2, Gulp, Karma, Jasmine, jQuery
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
html
src
test
.gitattributes
.gitignore
.travis.yml
README.md
gulpfile.js
karma.conf.js
package.json
test-main.js
tsconfig.json
webpack.config.js
webpack.test.js
yarn.lock

README.md

Build Status Coverage Status

yarn-webpack1-typescript2-karma-jasmine-jquery

Using Webpack 1 to bundle TypeScript 2 files. This project is an example on how to setup Unit Testing in a TypeScript 2 project using Karma as test runner and Jasmine as test framework. The project code itself tries to mimic a simplistic real-life example. It does that by using Webpack 1 to bundle TypeScript 2 files and including jQuery as JavaScript library.

Installation

Clone this project and follow these steps to get it up and running on your own computer.

  1. Install NodeJS and NPM for your system
  2. Install Yarn for your system (Why Yarn? Because NPM is so 2016. But seriously, read the pros on their website)
  3. Install Gulp globally: yarn add gulp --global
  4. Install project dependecies: yarn install

Run tests

You can use either gulp test or it's alias yarn test to run the karma test runner.

Build project

You can run gulp to build the project. Eventually when the build completes you'll find all the necessary files in the dist/ folder. It's possible to serve the files in this folder as a static website. You can use a simple webserver like http-server for testing purposes. For easier debugging you could also serve the build/ folder as static website. The uncompressed JavaScripts will be served when you load the index.html from that location.