Skip to content

Commit

Permalink
Ignore existing report dir in JUnit reporter
Browse files Browse the repository at this point in the history
fixes #837
  • Loading branch information
jason0x43 committed Nov 10, 2017
1 parent b7ae4ff commit f2141b1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
30 changes: 15 additions & 15 deletions docs/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -84835,7 +84835,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 29,
"line": 35,
"character": 7
}
]
Expand Down Expand Up @@ -84988,7 +84988,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 55,
"line": 61,
"character": 17
}
]
Expand All @@ -85005,7 +85005,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 55,
"line": 61,
"character": 11
}
],
Expand All @@ -85026,7 +85026,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 54,
"line": 60,
"character": 11
}
],
Expand All @@ -85051,7 +85051,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 53,
"line": 59,
"character": 9
}
],
Expand Down Expand Up @@ -85103,7 +85103,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 81,
"line": 87,
"character": 8
}
]
Expand Down Expand Up @@ -85135,7 +85135,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 88,
"line": 94,
"character": 21
}
]
Expand Down Expand Up @@ -85167,7 +85167,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 101,
"line": 107,
"character": 18
}
]
Expand Down Expand Up @@ -85238,7 +85238,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 75,
"line": 81,
"character": 11
}
]
Expand Down Expand Up @@ -85274,7 +85274,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 119,
"line": 125,
"character": 9
}
]
Expand Down Expand Up @@ -85312,7 +85312,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 52,
"line": 58,
"character": 13
}
]
Expand Down Expand Up @@ -85369,7 +85369,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 43,
"line": 49,
"character": 9
}
],
Expand Down Expand Up @@ -85430,7 +85430,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 42,
"line": 48,
"character": 32
}
],
Expand Down Expand Up @@ -85500,7 +85500,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 133,
"line": 139,
"character": 24
}
]
Expand Down Expand Up @@ -85573,7 +85573,7 @@
"sources": [
{
"fileName": "lib/reporters/JUnit.ts",
"line": 144,
"line": 150,
"character": 23
}
]
Expand Down
8 changes: 7 additions & 1 deletion src/lib/reporters/JUnit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ export default class JUnit extends Reporter {
if (options.filename) {
this.filename = options.filename;
if (dirname(this.filename) !== '.') {
mkdirSync(dirname(this.filename));
try {
mkdirSync(dirname(this.filename));
} catch (error) {
if (error.code !== 'EEXIST') {
throw error;
}
}
}
this.output = createWriteStream(this.filename);
}
Expand Down

0 comments on commit f2141b1

Please sign in to comment.