Skip to content

Commit

Permalink
Replace CID in file name with UUID. Addresses issue #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Davis committed Aug 22, 2016
1 parent b4baa1b commit 2c48096
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import events from 'events'
import path from 'path'
import fs from 'fs'
import mkdirp from 'mkdirp'
import uuid from 'uuid'

/**
* Initialize a new `Json` test reporter.
Expand Down Expand Up @@ -113,7 +114,7 @@ class JsonReporter extends events.EventEmitter {

try {
const dir = path.resolve(this.options.outputDir)
const filename = 'WDIO.json.' + runnerInfo.sanitizedCapabilities + '.' + cid + '.json'
const filename = 'WDIO.json.' + runnerInfo.sanitizedCapabilities + '.' + uuid.v1() + '.json'
const filepath = path.join(dir, filename)
mkdirp.sync(dir)
fs.writeFileSync(filepath, JSON.stringify(json))
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wdio-json-reporter",
"version": "0.0.3",
"version": "0.0.4",
"description": "A WebdriverIO plugin. Report results in json format.",
"main": "build/reporter.js",
"scripts": {
Expand Down Expand Up @@ -31,7 +31,8 @@
"homepage": "https://github.com/fijijavis/wdio-json-reporter#readme",
"dependencies": {
"babel-runtime": "^5.8.25",
"mkdirp": "^0.5.1"
"mkdirp": "^0.5.1",
"uuid": "^2.0.2"
},
"devDependencies": {
"babel": "^5.8.23",
Expand Down

0 comments on commit 2c48096

Please sign in to comment.