Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #11775 from brave/muon-issue-374
Browse files Browse the repository at this point in the history
use `CHROME_USER_DATA_DIR` to set/override the user data dir in tests
  • Loading branch information
ayumi committed Nov 3, 2017
1 parent b493c5b commit 08d5931
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/lib/brave.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const logVerbose = (string, ...rest) => {
}

const generateUserDataDir = () => {
return path.join(os.tmpdir(), 'brave-test', (new Date().getTime()) + Math.floor(Math.random() * 1000).toString())
return process.env.BRAVE_USER_DATA_DIR || path.join(os.tmpdir(), 'brave-test', (new Date().getTime()) + Math.floor(Math.random() * 1000).toString())
}

const rmDir = (dirPath) => {
Expand Down Expand Up @@ -1171,7 +1171,7 @@ var exports = {
}
let env = {
NODE_ENV: 'test',
BRAVE_USER_DATA_DIR: userDataDir,
CHROME_USER_DATA_DIR: userDataDir,
SPECTRON: true
}
this.app = new Application({
Expand Down

0 comments on commit 08d5931

Please sign in to comment.