mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Fixed source maps for when test files error out. See https://github.com/brunch/brunch/issues/842
This commit is contained in:
parent
2cbc33d66d
commit
5104f0a1e7
3 changed files with 23 additions and 4 deletions
|
@ -114,7 +114,7 @@
|
|||
getWindowLocation: function() { return window.location; }
|
||||
});
|
||||
|
||||
var catchingExceptions = queryString.getParam("catch");
|
||||
var catchingExceptions = false; // Setting to false always for CodeCombat, because Jasmine-HTML's reporter doesn't do source maps, and Chrome console does.
|
||||
env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions);
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,9 +13,9 @@ module.exports = class TestView extends CocoView
|
|||
constructor: (options, @subPath='') ->
|
||||
super(options)
|
||||
@subPath = @subPath[1..] if @subPath[0] is '/'
|
||||
@loadJasmine() unless TestView.loaded
|
||||
@loadTestingLibs() unless TestView.loaded
|
||||
|
||||
loadJasmine: ->
|
||||
loadTestingLibs: ->
|
||||
@queue = new createjs.LoadQueue()
|
||||
@queue.on('complete', @scriptsLoaded, @)
|
||||
for f in ['jasmine', 'jasmine-html', 'boot', 'mock-ajax', 'test-app']
|
||||
|
@ -102,7 +102,15 @@ module.exports = class TestView extends CocoView
|
|||
jasmine.Ajax.install()
|
||||
beforeEach ->
|
||||
jasmine.Ajax.requests.reset()
|
||||
# TODO get some setup and teardown prepped
|
||||
Backbone.Mediator.init()
|
||||
# TODO Stubbify more things
|
||||
# * document.location
|
||||
# * firebase
|
||||
|
||||
afterEach ->
|
||||
# TODO Clean up more things
|
||||
# * Events
|
||||
|
||||
require f for f in @specFiles # runs the tests
|
||||
|
||||
destroy: ->
|
||||
|
|
|
@ -76,6 +76,8 @@ exports.config =
|
|||
framework: 'backbone'
|
||||
|
||||
plugins:
|
||||
autoReload:
|
||||
delay: 300 # for race conditions, particularly waiting for onCompile to do its thing
|
||||
coffeelint:
|
||||
pattern: /^app\/.*\.coffee$/
|
||||
options:
|
||||
|
@ -91,3 +93,12 @@ exports.config =
|
|||
uglify:
|
||||
output:
|
||||
semicolons: false
|
||||
|
||||
onCompile: (files) ->
|
||||
exec = require('child_process').exec
|
||||
regexFrom = '\\/\\/# sourceMappingURL=([^\\/].*)\\.map'
|
||||
regexTo = '\\/\\/# sourceMappingURL=\\/javascripts\\/$1\\.map'
|
||||
regex = "s/#{regexFrom}/#{regexTo}/g"
|
||||
for file in files
|
||||
c = "perl -pi -e '#{regex}' #{file.path}"
|
||||
exec c
|
||||
|
|
Loading…
Reference in a new issue