Skip to content

Commit

Permalink
server: fix missing reject arg and add test (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbreiding authored and brian-mann committed Nov 21, 2017
1 parent 356e306 commit 88efc33
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/server/lib/plugins/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
init: (config, options) ->
log("plugins.init", config.pluginsFile)

new Promise (resolve) ->
new Promise (resolve, reject) ->
return resolve() if not config.pluginsFile

if pluginsProcess
Expand Down
12 changes: 12 additions & 0 deletions packages/server/test/unit/plugins/index_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ describe "lib/plugins/index", ->
)
expect(value).to.equal("value")

describe "load:error message", ->
beforeEach ->
@ipc.on.withArgs("load:error").yields("PLUGINS_FILE_ERROR", "path/to/pluginsFile.js", "error message")

it "rejects plugins.init", ->
plugins.init({ pluginsFile: "cypress-plugin" })
.catch (err) =>
expect(err.message).to.contain("The plugins file is missing or invalid")
expect(err.message).to.contain("path/to/pluginsFile.js")
expect(err.message).to.contain("The following error was thrown")
expect(err.message).to.contain("error message")

describe "error message", ->
beforeEach ->
@err = {
Expand Down

0 comments on commit 88efc33

Please sign in to comment.