From 815da957c11456197192a0eb02ec8709ad88d890 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 7 Aug 2019 12:39:42 +0200 Subject: [PATCH] return compilation result instead of a label && take in account propoerty --- remix-tests/src/compiler.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/remix-tests/src/compiler.ts b/remix-tests/src/compiler.ts index 9b56eadc75..e84f1780b2 100644 --- a/remix-tests/src/compiler.ts +++ b/remix-tests/src/compiler.ts @@ -73,10 +73,12 @@ export function compileFileOrFiles(filename: string, isDirectory: boolean, opts: compiler.compile(sources, filepath) } ], function (err: Error | null | undefined, result: any) { - let errors = (result.errors || []).filter((e) => e.type === 'Error' || e.severity === 'error') + let error: Error[] = [] + if (result.error) error.push(result.error) + let errors = (result.errors || error).filter((e) => e.type === 'Error' || e.severity === 'error') if (errors.length > 0) { if (!isBrowser) require('signale').fatal(errors) - return cb(new Error('errors compiling')) + return cb(errors) } cb(err, result.contracts) }) @@ -121,7 +123,7 @@ export function compileContractSources(sources: SrcIfc, importFileCb: any, opts: let errors = (result.errors || error).filter((e) => e.type === 'Error' || e.severity === 'error') if (errors.length > 0) { if (!isBrowser) require('signale').fatal(errors) - return cb(new Error('errors compiling')) + return cb(errors) } cb(err, result.contracts) })