Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
63 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`build fails with an error if a build script has not been found 1`] = `"Could not find build script for \\"testConfig\\" in Detox config at: /etc/detox/config"`; | ||
exports[`build fails with an error if a build script has not been found 1`] = ` | ||
"Could not find a build script inside \\"testConfig\\" configuration. | ||
HINT: Check contents of your Detox config at: /etc/detox/config | ||
{}" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
const CustomError = require('./CustomError'); | ||
const DetoxRuntimeError = require('./DetoxRuntimeError'); | ||
|
||
class DetoxConfigError extends CustomError {} | ||
class DetoxConfigError extends DetoxRuntimeError { | ||
constructor(opts) { | ||
super(opts); | ||
this.name = 'DetoxConfigError'; | ||
} | ||
} | ||
|
||
module.exports = DetoxConfigError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,33 @@ | ||
const _ = require('lodash'); | ||
const util = require('util'); | ||
|
||
class DetoxRuntimeError extends Error { | ||
constructor({ message = '', hint = '', debugInfo = '' } = {}) { | ||
constructor({ | ||
message = '', | ||
hint = '', | ||
debugInfo = '', | ||
inspectOptions, | ||
} = {}) { | ||
const formattedMessage = _.compact([ | ||
message, | ||
hint && `HINT: ${hint}`, | ||
debugInfo | ||
_.isObject(debugInfo) ? inspectObj(debugInfo, inspectOptions) : debugInfo, | ||
]).join('\n\n'); | ||
|
||
super(formattedMessage); | ||
this.name = 'DetoxRuntimeError'; | ||
} | ||
} | ||
|
||
function inspectObj(obj, options) { | ||
return util.inspect(obj, { | ||
colors: false, | ||
compact: false, | ||
depth: 0, | ||
showHidden: false, | ||
|
||
...options, | ||
}); | ||
} | ||
|
||
module.exports = DetoxRuntimeError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters