mirror of https://github.com/status-im/metro.git
Always report filename
Reviewed By: cpojer Differential Revision: D5764824 fbshipit-source-id: cb90e429176764d4a1043fd57bbfee223361a182
This commit is contained in:
parent
6e415bcb2f
commit
2377f04f4a
|
@ -6,6 +6,7 @@
|
|||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @emails oncall+javascript_tools
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
@ -100,7 +101,9 @@ describe('Transformer', function() {
|
|||
.transformFile(fileName, localPath, '', {})
|
||||
.catch(function(error) {
|
||||
expect(error.type).toEqual('TransformError');
|
||||
expect(error.message).toBe('SyntaxError ' + message);
|
||||
expect(error.message).toBe(
|
||||
'SyntaxError in /an/arbitrary/file.js: ' + message,
|
||||
);
|
||||
expect(error.lineNumber).toBe(2);
|
||||
expect(error.column).toBe(15);
|
||||
expect(error.filename).toBe(fileName);
|
||||
|
|
|
@ -224,7 +224,7 @@ function formatGenericError(err, filename) {
|
|||
function formatBabelError(err, filename) {
|
||||
var error = new TransformError();
|
||||
error.type = 'TransformError';
|
||||
error.message = (err.type || error.type) + ' ' + err.message;
|
||||
error.message = `${err.type || error.type} in ${filename}: ${err.message}`;
|
||||
error.stack = err.stack;
|
||||
error.snippet = err.codeFrame;
|
||||
error.lineNumber = err.loc.line;
|
||||
|
|
Loading…
Reference in New Issue