LoginSignup
5

More than 5 years have passed since last update.

ES6+Karma+Jasmine環境のテンプレート

Last updated at Posted at 2016-01-14

ちょっとしたES6スクリプトをテスト付きでさくっと試すためのテンプレを作りました。

テストランナーはKarma、テスト本体はJasmineです。

はじめてpackage.jsonとかreadmeまじめに書きました。

任意のリポジトリを作成して、一時的にこのテンプレをリモートに設定し、プルしてからリモートを削除。

git remote add babel-starter https://github.com/110chang/babel-starter.git
git pull babel-starter master
git remote rm babel-starter
npm i
karma start

余談ですが、Generatorを動かすにはbabel-polyfillをインストールして、設定に加える必要があるみたいです。

    ...
    // list of files / patterns to load in the browser
    files: [
      'node_modules/babel-polyfill/browser.js',
      ...
    ],
    ...

via http://stackoverflow.com/questions/28976748/regeneratorruntime-is-not-defined

ブログにも掲載しました

fixtureの使用について続きを書きました

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5