試験は twada/battlefield-sourcemaps で行っている
- SourceMap 対応が入った espower 0.9.0 を使う
- espower(ast, options) の第二引数 options に
sourceMap
というキーで上流の SourceMap オブジェクトを入れる
module.exports = function (api) { | |
const presets = []; | |
const plugins = []; | |
let retainLines = false; | |
let comments = true; | |
if (api.env('production')) { | |
plugins.push('babel-plugin-unassert'); | |
retainLines = true; | |
} |
{ | |
"env": { | |
"development": { | |
"presets": [ | |
"babel-preset-power-assert" | |
] | |
}, | |
"production": { | |
"plugins": [ | |
"babel-plugin-unassert" |
var gulp = require('gulp'); | |
var mocha = require('gulp-mocha'); | |
gulp.task('test', function () { | |
require('espower-coffee/guess'); | |
return gulp | |
.src('test/**/*.coffee') | |
.pipe(mocha()); | |
}); |
試験は twada/battlefield-sourcemaps で行っている
sourceMap
というキーで上流の SourceMap オブジェクトを入れるvar empower = require('empower'); | |
var formatter = require('power-assert-formatter'); | |
module.exports = function empowerZombie (browser) { | |
empower(browser.assert, formatter(), { | |
destructive: true, | |
modifyMessageOnRethrow: true, | |
saveContextOnRethrow: true, | |
patterns: [ | |
'browser.assert.redirected([message])', |
/** | |
* empower.js - Power Assert feature enhancer for assert function/object. | |
* | |
* https://github.com/twada/empower | |
* | |
* Copyright (c) 2013-2014 Takuto Wada | |
* Licensed under the MIT license. | |
* https://raw.github.com/twada/empower/master/MIT-LICENSE.txt | |
* | |
* A part of extend function is: |
# -*- coding: utf-8 -*- | |
# Find japanese entry for each en.wikipedia.org link in TARGET_URL (quick & dirty hack) | |
# USAGE: ruby wikipedia_ja.rb TARGET_URL | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
def ja_url_for(url) | |
link_ja = Nokogiri::HTML(open(url)).css('li.interlanguage-link.interwiki-ja a').first |
require 'spec/runner/formatter/progress_bar_formatter' | |
class JojoRushFormatter < Spec::Runner::Formatter::ProgressBarFormatter | |
def example_failed(example, counter, failure) | |
@output.print colorize_failure('無駄', failure) | |
@output.flush | |
end | |
def example_passed(example) | |
@output.print green('オラ') | |
@output.flush |
exports = module.exports = global; | |
var path = require('path'); | |
QUnit = require(path.join(path.dirname(require.resolve('qunit-tap')), '..', 'vendor', 'qunit', 'qunit', 'qunit')).QUnit; | |
require("qunit-tap").qunitTap(QUnit, require("sys").puts, { noPlan: true }); | |
QUnit.init(); | |
QUnit.config.updateRate = 0; | |
exports.assert = QUnit; |