Skip to content

Commit

Permalink
Adds a failing test around plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Jun 10, 2017
1 parent ebc8d53 commit 8a0341e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"spellchecker.ignoreRegExp": [],
"spellchecker.ignoreFileExtensions": [],
"spellchecker.checkInterval": 5000,
"eslint.enable": false,
"editor.formatOnSave": true,
"prettier.singleQuote": false,
"prettier.trailingComma": "es5",
Expand Down
11 changes: 11 additions & 0 deletions source/runner/_tests/_danger_runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ describe("with fixtures", () => {
},
])
})

it("can handle a plugin (which is already used in Danger)", async () => {
const context = await setupDangerfileContext()
const runtime = await createDangerfileRuntimeEnvironment(context)
const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfilePlugin.js"), runtime)
expect(results.errors).toEqual([
{
message: "Plugged in",
},
])
})
})

describe("cleaning Dangerfiles", () => {
Expand Down
3 changes: 3 additions & 0 deletions source/runner/_tests/fixtures/__DangerfilePlugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import "danger-plugin-yarn"

fail("Plugged in")

0 comments on commit 8a0341e

Please sign in to comment.