UNPKG

coffee-toaster

Version:

Minimalist manager and build system for CoffeeScript, an alternative for AMD's or CJS's OOP patterns, but with similar results. Made for those who dare to use class definitions in CoffeeScript while being able to easily inherit from external files. Powered with imports directives that use wildcards facilities, exposed scopes and excluded files filter options. The system can even use folders-as-namespaces to help you avoid naming collisions in architecture.

36 lines (27 loc) 998 B
fs = require 'fs' path = require 'path' events = require "events" vows = require "vows" assert = require "assert" {FsUtil} = (require __dirname + "/../lib/toaster").toaster.utils {spawn_toaster,snapshot} = require "./utils/utils" error_message = "ERROR Parse error on line 12: Unexpected 'UNARY' at file: app.coffee" vows.describe( 'Error with line number' ) .addBatch( 'Compiling a project': 'that has syntax error on file "app.js" at line 12': topic:-> report_msg = null folder = __dirname + '/_templates/error_with_line_number' toaster = spawn_toaster ['-c', folder] toaster.stdout.on 'data', (data)-> unless report_msg? report_msg = data.toString().stripColors.replace /\n/g, "" toaster.stderr.on 'data', ( error )-> @callback error toaster.on 'exit', (data)=> @callback null, report_msg undefined 'should rise the error precisely':( err, reported_msg )-> assert.equal err, null assert.equal reported_msg, error_message ).export module