Last active
August 29, 2015 14:16
-
-
Save stomita/df4a4826eb9278e3d853 to your computer and use it in GitHub Desktop.
browserify+espowerifyでassertの結果がおかしくなる件
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* browserify -t espowerify ./build/test/e2e/app001.test.js > ./build/test/e2e/app001.test-bundle-by-cmd.js | |
*/ | |
//... | |
'use strict'; | |
var assert = require('power-assert'); | |
describe('apptest001', function () { | |
it('should raise', function () { | |
assert(assert._expr(assert._capt(1 === 0, 'arguments/0'), { | |
content: 'assert(1 === 0)', | |
filepath: '/tmp/tmpproject/build/test/e2e/app001.test.js', | |
line: 7 | |
})); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
'use strict'; | |
var assert = require('power-assert'); | |
describe('apptest001', function () { | |
it('should raise', function () { | |
assert(assert._expr(assert._capt(assert._capt(assert, 'arguments/0/callee/object')._expr(assert._capt(assert._capt(assert, 'arguments/0/arguments/0/callee/object')._capt(assert._capt(1 === 0, 'arguments/0/arguments/0/arguments/0'), 'arguments/0'), 'arguments/0/arguments/0'), { | |
content: 'assert(1 === 0)', | |
filepath: '/tmp/tmpproject/build/test/e2e/app001.test.js', | |
line: 7 | |
}), 'arguments/0'), { | |
content: 'assert(assert._expr(assert._capt(1 === 0, \'arguments/0\'), {content: \'assert(1 === 0)\',filepath: \'/tmp/tmpproject/build/test/e2e/app001.test.js\',line: 7}))', | |
filepath: '/tmp/tmpproject/build/test/e2e/app001.test.js', | |
line: 7 | |
})); | |
}); | |
}); | |
//... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var assert = require("power-assert"); | |
describe("apptest001", function() { | |
it("should raise", function() { | |
assert(1 === 0); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp = require "gulp" | |
browserify = require "browserify" | |
espowerify = require "espowerify" | |
source = require "vinyl-source-stream" | |
# Bundle test scripts for browser testing | |
gulp.task "bundle", -> | |
browserify "./build/test/e2e/app001.test.js", | |
transform: [ espowerify ] | |
.bundle() | |
.pipe source("app001.test-bundle.js") | |
.pipe gulp.dest "./build/test/e2e" |
browserifyのバージョンを最新(9.0.3)にあげたらなおりました
この現象が出たバージョン:8.1.3
ちなみにコマンドラインで適用したbrowserifyのバージョンはglobalのだったのでもっと古かった(5.9.1)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
app001.test.js
が元ファイルapp001.test-bundle-by-cmd.js
は正しく出力されているapp001.test-bundle.js
は gulpからbrowserify(+espowerify)を実行した結果(共に関係ない部分は省略)