Skip to content

Commit

Permalink
normalize slashes in in test filenames and log output
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed May 27, 2018
1 parent ca92f3e commit c301680
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/jest-cli/src/reporters/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const formatTestPath = (
testPath: Path,
) => {
const {dirname, basename} = relativePath(config, testPath);
return chalk.dim(dirname + path.sep) + chalk.bold(basename);
return slash(chalk.dim(dirname + path.sep) + chalk.bold(basename));
};

export const relativePath = (
Expand Down
1 change: 1 addition & 0 deletions packages/jest-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"is-ci": "^1.0.10",
"jest-message-util": "^23.0.0",
"mkdirp": "^0.5.1",
"slash": "^1.0.0",
"source-map": "^0.6.0"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/jest-util/src/get_console_output.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ import type {ConsoleBuffer} from 'types/Console';

import path from 'path';
import chalk from 'chalk';
import slash from 'slash';

export default (root: string, verbose: boolean, buffer: ConsoleBuffer) => {
const TITLE_INDENT = verbose ? ' ' : ' ';
const CONSOLE_INDENT = TITLE_INDENT + ' ';

return buffer.reduce((output, {type, message, origin}) => {
origin = path.relative(root, origin);
origin = slash(path.relative(root, origin));
message = message
.split(/\n/)
.map(line => CONSOLE_INDENT + line)
Expand Down

0 comments on commit c301680

Please sign in to comment.