Skip to content

Commit

Permalink
test(api): Improve error logging on integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
nicojs committed Jul 7, 2018
1 parent a820577 commit 701b36a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@ describe('we have a module using stryker', function () {

const modulePath = path.resolve(__dirname, '../../../testResources/module');

const execInModule = (command: string) => {
console.log(`Exec '${command}' in ${modulePath}`);
return exec(command, { cwd: modulePath });
function execInModule (command: string): Promise<[string, string]> {
return new Promise((res, rej) => {
console.log(`Exec '${command}' in ${modulePath}`);
exec(command, { cwd: modulePath }, (error, stdout, stderr) => {
if (error) {
console.log(stdout);
console.error(stderr);
rej(error);
} else {
res([stdout, stderr]);
}
});
});
};

describe('after installing Stryker', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/stryker/src/logging/LogConfigurator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const layouts: { color: log4js.PatternLayout, noColor: log4js.PatternLayout } =
type: 'pattern',
pattern: '%r (%z) %p %c %m'
}
}
};

interface AppendersConfiguration {
[name: string]: log4js.Appender;
Expand Down
2 changes: 1 addition & 1 deletion packages/stryker/test/unit/logging/LogConfiguratorSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe('LogConfigurator', () => {
const notColoredLayout: log4js.PatternLayout = {
type: 'pattern',
pattern: '%r (%z) %p %c %m'
}
};
return {
appenders: {
console: { type: 'stdout', layout: coloredLayout },
Expand Down

0 comments on commit 701b36a

Please sign in to comment.