You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
What is power-assert? is an implementation of "Power Assert" concept in JavaScript. provides descriptive assertion messages through standard assert interface. No API is the best API. With power-assert, you don't need to learn many assertion library APIs (in most cases, all you need to remember is just an assert(any_expression) function) Stop memorizing tons of assertion APIs. Just create expressio
前回 QiitaにReact.js の React.js の公式Tutorial を gulp を利用して簡単に実行できる環境を作って、ES6も試した で公式TutorialをECMA2015(ECMA6)を利用して書き直しを行ったのですが、ReactといえばFlux、Flux といえばRedux ということで、流行りのRedux を利用して記述したらどうなるのかを試してみました。 また 同じく流行りのテスト環境である Mocha + power-assert を利用して、テストを追加してみました。 React および Redux はテストも非常に行いやすいのを体感しました。 前回の続編として、以下GitHub で公開しています。 https://github.com/ma-tu/react-babel-gulp-browserify-tutorial/tree/es6-redux Rea
"babel-core": "^6.3.26", "babel-loader": "^6.2.0", "babel-preset-es2015": "^6.3.13", "babel-preset-react": "^6.3.13", "chai": "^3.4.1", "istanbul-instrumenter-loader": "^0.1.3", "karma-coverage": "^0.5.3", "karma-mocha": "^0.2.1", "karma-mocha-reporter": "^1.1.4", "karma-phantomjs-launcher": "^0.2.2", "karma-phantomjs-shim": "^1.2.0", "karma-sourcemap-loader": "^0.3.6", "karma-webpack": "^1.7.0",
// Karma configuration // Generated on Mon Dec 21 2015 12:22:32 GMT+0900 (JST) module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['mocha', 'browserify'], // list of files / patterns to load in the browser f
(..or maybe Mocha 4. I don't know.) @mochajs/mocha + everyone, I mentioned this in the mochajs/maintainers room on Gitter, but since it appears people aren't using Gitter much, I'll repeat it here: Pitch Mocha's old. What's cool about that is that we know what's wrong with it. And indeed, it has problems which make certain issues difficult to address. The major issue is "plugins". Others include (
自動テストって意識高そうで恰好良いですよね! 普段ブラウザ用のJavaScriptしか書かない人なのですが、テストについて調べても、難しい話から始まる記事ばかりで「アサーションって何?」とか「何で通常のファイルとは別のjsが必要なの?」みたいな気持でした。この記事では簡単な前提条件から、mocha/chaiの使い方の概要が分かる部分までを説明したいと思います。 そもそもテストとは何? ソフトウェア開発におけるテストとは、ソフトウェアの振舞いが想定した通りであるかを検証することです。ソフトウェアのサブルーチンを取り出してテストする「単体テスト/ユニットテスト」と、ソフトウェア全体の挙動をテストする「結合テスト」があります。mocha・chaiはこのうちの「単体テスト」を対象としたツールです。 じゃあ単体テストって何をすることなの? 単体テストとは、ある特定の関数を対象に、入力値と出力値が仕様
describe('Todo', () => { var Todo: any = require('../lib/todo'); // 既に大部分が実装されているものとする var TodoStub: any; beforeEach(() => { /* TodoStub */ TodoStub = { get: sinon.stub(Todo.prototype, 'get').returns('dummy'), put: sinon.stub(Todo.prototype, 'put'), remove: sinon.stub(Todo.prototype, 'remove'), }; }); });
What should I be testing and when should I be writing tests? A frontend development article by Andy Shora ← back to andyshora.com | Tweet this article Why do you need to write tests? Because you're not Chuck Norris. Chuck Norris' code tests itself, and it always passes, with 0ms execution time. Ok, seriously, writing tests feels good! I think it's essential that you learn to love the feeling of ha
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く