GetEmitOutput And Testfiles

you do not need to concat. all you need is to know if there are errors or not. as a matter of fact you should bail out once you find the first syntax error.

so something like:
```TypeScript
var hasSentacticDiagnostics = false; 
if (emitToSingleFile) {
      // Check only the file we want to emit
      hasSentacticDiagnostics = containErrors(program.getDiagnostics(targetSourceFile));
}
else {
    hasSentacticDiagnostics = forEach(program.getSourceFiles(), sourceFile => { 
        // Emit to a single file then we will check all files that do not have external module 
        if (!isExternalModuleOrDeclarationFile(sourceFile)) { 
            return containErrors(program.getDiagnostics(sourceFile));
        }
       return false;
    });
}
```