Skip to content

Commit

Permalink
Regenerating fixtures with paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Devon Stewart committed Feb 25, 2022
1 parent 42400d2 commit dca6a04
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/fixtures/__generated__/graphql-paths-forking.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions test/fixtures/__generated__/graphql-paths-merge-commit.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions test/fixtures/__generated__/graphql-paths-overlapping-label.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions test/fixtures/__generated__/graphql-paths-rebase-merging.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions test/fixtures/__generated__/graphql-paths-squash-merging.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions test/fixtures/config/config-with-include-paths.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include-paths:
- README.md
54 changes: 54 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const release3Payload = require('./fixtures/release-3.json')
const pushNonMasterPayload = require('./fixtures/push-non-master-branch.json')
const graphqlCommitsNoPRsPayload = require('./fixtures/graphql-commits-no-prs.json')
const graphqlCommitsMergeCommit = require('./fixtures/__generated__/graphql-commits-merge-commit.json')
const graphqlPathsMergeCommit = require('./fixtures/__generated__/graphql-paths-merge-commit.json')
const graphqlCommitsEmpty = require('./fixtures/graphql-commits-empty.json')
const releaseDrafterFixture = require('./fixtures/release-draft.json')
const graphqlCommitsOverlappingLabel = require('./fixtures/__generated__/graphql-commits-overlapping-label.json')
Expand Down Expand Up @@ -2118,6 +2119,59 @@ describe('release-drafter', () => {
})
})

describe('with include-paths config', () => {
it('FIXME: returns the modified paths', async () => {
// FIXME: No idea how to actually write this test.
getConfigMock('config-with-include-paths.yml')

nock('https://api.github.com')
.post('/graphql', (body) =>
body.query.includes('query findCommitsWithAssociatedPullRequests')
)
.reply(200, graphqlCommitsMergeCommit)

nock('https://api.github.com')
.post('/graphql', (body) =>
body.query.includes('query findCommitsWithPathChangesQuery')
)
.reply(200, graphqlPathsMergeCommit)

nock('https://api.github.com')
.get(
'/repos/toolmantim/release-drafter-test-project/releases?per_page=100'
)
.reply(200, [])

// nock('https://api.github.com')
// .post(
// '/repos/toolmantim/release-drafter-test-project/releases',
// (body) => {
// expect(body).toMatchInlineSnapshot(`
// Object {
// "body": "dummy",
// "draft": true,
// "name": "",
// "prerelease": false,
// "tag_name": "",
// "target_commitish": "refs/heads/master",
// }
// `)
// return true
// }
// )
// .reply(200, releasePayload)

const payload = pushPayload

await probot.receive({
name: 'push',
payload,
})

// expect.assertions(1)
})
})

describe('config error handling', () => {
it('schema error', async () => {
getConfigMock('config-with-schema-error.yml')
Expand Down

0 comments on commit dca6a04

Please sign in to comment.