Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
test(pull-request): pass msg to new issue test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Garant committed Nov 4, 2019
1 parent 4383291 commit c51b481
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 6 deletions.
6 changes: 3 additions & 3 deletions __tests__/__snapshots__/issue.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ https://github.com/protoEvangelion/gh/issues/1#issuecomment-000000001
"
`;

exports[`E2E: Issues Module Test Create a new issue \`gh is -N -t "Node GH rocks!" -L bug,question,test\` 1`] = `
exports[`E2E: Issues Module Test Create a new issue \`gh is -N -t "Node GH rocks!" -m "msg" -L bug,question,test\` 1`] = `
"Creating a new issue on protoEvangelion/gh
https://github.com/protoEvangelion/gh/issues/88
[hook] gh is --browser --user protoEvangelion --repo gh --number 88
https://github.com/protoEvangelion/gh/issues/000000001
[hook] gh is --browser --user protoEvangelion --repo gh --number 132
"
`;

Expand Down
6 changes: 4 additions & 2 deletions __tests__/issue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ describe('E2E: Issues Module Test', () => {
done()
})

it('Create a new issue `gh is -N -t "Node GH rocks!" -L bug,question,test`', done => {
expect(runCmd(`gh is -N -t "Node GH rocks!" -L bug,question,test`)).toMatchSnapshot()
it('Create a new issue `gh is -N -t "Node GH rocks!" -m "msg" -L bug,question,test`', done => {
expect(
runCmd(`gh is -N -t "Node GH rocks!" -m "msg" -L bug,question,test`)
).toMatchSnapshot()
done()
})

Expand Down
138 changes: 137 additions & 1 deletion __tests__/nockFixtures/IssueNew.json
Original file line number Diff line number Diff line change
@@ -1 +1,137 @@
[{"scope":"https://api.github.com:443","method":"POST","path":"/repos/protoEvangelion/gh/issues?","body":{"title":"Node GH rocks!","labels":["bug","question","test"]},"status":201,"response":{"url":"https://api.github.com/repos/protoEvangelion/gh/issues/88","repository_url":"https://api.github.com/repos/protoEvangelion/gh","labels_url":"https://api.github.com/repos/protoEvangelion/gh/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/protoEvangelion/gh/issues/88/comments","events_url":"https://api.github.com/repos/protoEvangelion/gh/issues/88/events","html_url":"https://github.com/protoEvangelion/gh/issues/88","id":1000,"node_id":1001,"number":88,"title":"Node GH rocks!","user":{"login":"protoEvangelion","id":1002,"node_id":1003,"avatar_url":"https://avatars3.githubusercontent.com/u/000000001?v=4","gravatar_id":"","url":"https://api.github.com/users/protoEvangelion","html_url":"https://github.com/protoEvangelion","followers_url":"https://api.github.com/users/protoEvangelion/followers","following_url":"https://api.github.com/users/protoEvangelion/following{/other_user}","gists_url":"https://api.github.com/users/protoEvangelion/gists{/gist_id}","starred_url":"https://api.github.com/users/protoEvangelion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/protoEvangelion/subscriptions","organizations_url":"https://api.github.com/users/protoEvangelion/orgs","repos_url":"https://api.github.com/users/protoEvangelion/repos","events_url":"https://api.github.com/users/protoEvangelion/events{/privacy}","received_events_url":"https://api.github.com/users/protoEvangelion/received_events","type":"User","site_admin":false},"labels":[{"id":1004,"node_id":1005,"url":"https://api.github.com/repos/protoEvangelion/gh/labels/bug","name":"bug","color":"ee0701","default":true},{"id":1006,"node_id":1007,"url":"https://api.github.com/repos/protoEvangelion/gh/labels/question","name":"question","color":"cc317c","default":true},{"id":1008,"node_id":1009,"url":"https://api.github.com/repos/protoEvangelion/gh/labels/test","name":"test","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-10T16:00:00Z","updated_at":"2017-10-10T16:00:00Z","closed_at":null,"author_association":"OWNER","body":null,"closed_by":null},"rawHeaders":["Server","GitHub.com","Date","Sun, 13 Jan 2019 05:56:33 GMT","Content-Type","application/json; charset=utf-8","Content-Length","2296","Connection","close","Status","201 Created","X-RateLimit-Limit","5000","X-RateLimit-Remaining","4976","X-RateLimit-Reset","1547361548","Cache-Control","private, max-age=60, s-maxage=60","Vary","Accept, Authorization, Cookie, X-GitHub-OTP","ETag","\"66fbde146647e5337f85bef90055f979\"","X-OAuth-Scopes","user, public_repo, repo, repo:status, delete_repo, gist","X-Accepted-OAuth-Scopes","","Location","https://api.github.com/repos/protoEvangelion/gh/issues/88","X-GitHub-Media-Type","github.v3; format=json","Access-Control-Expose-Headers","ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type","Access-Control-Allow-Origin","*","Strict-Transport-Security","max-age=31536000; includeSubdomains; preload","X-Frame-Options","deny","X-Content-Type-Options","nosniff","X-XSS-Protection","1; mode=block","Referrer-Policy","origin-when-cross-origin, strict-origin-when-cross-origin","Content-Security-Policy","default-src 'none'","X-GitHub-Request-Id","C774:0F0D:38D249:7D343C:5C3AD311"]}]
[
{
"scope": "https://api.github.com:443",
"method": "POST",
"path": "/repos/protoEvangelion/gh/issues",
"body": {
"body": "msg",
"title": "Node GH rocks!",
"labels": ["bug", "question", "test"]
},
"status": 201,
"response": {
"url": "https://api.github.com/repos/protoEvangelion/gh/issues/000000001",
"repository_url": "https://api.github.com/repos/protoEvangelion/gh",
"labels_url": "https://api.github.com/repos/protoEvangelion/gh/issues/000000001/labels{/name}",
"comments_url": "https://api.github.com/repos/protoEvangelion/gh/issues/000000001/comments",
"events_url": "https://api.github.com/repos/protoEvangelion/gh/issues/000000001/events",
"html_url": "https://github.com/protoEvangelion/gh/issues/000000001",
"id": 1000,
"node_id": 1001,
"number": 132,
"title": "Node GH rocks!",
"user": {
"login": "protoEvangelion",
"id": 1002,
"node_id": 1003,
"avatar_url": "https://avatars3.githubusercontent.com/u/000000001?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/protoEvangelion",
"html_url": "https://github.com/protoEvangelion",
"followers_url": "https://api.github.com/users/protoEvangelion/followers",
"following_url": "https://api.github.com/users/protoEvangelion/following{/other_user}",
"gists_url": "https://api.github.com/users/protoEvangelion/gists{/gist_id}",
"starred_url": "https://api.github.com/users/protoEvangelion/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/protoEvangelion/subscriptions",
"organizations_url": "https://api.github.com/users/protoEvangelion/orgs",
"repos_url": "https://api.github.com/users/protoEvangelion/repos",
"events_url": "https://api.github.com/users/protoEvangelion/events{/privacy}",
"received_events_url": "https://api.github.com/users/protoEvangelion/received_events",
"type": "User",
"site_admin": false
},
"labels": [
{
"id": 1004,
"node_id": 1005,
"url": "https://api.github.com/repos/protoEvangelion/gh/labels/bug",
"name": "bug",
"color": "ededed",
"default": true
},
{
"id": 1006,
"node_id": 1007,
"url": "https://api.github.com/repos/protoEvangelion/gh/labels/question",
"name": "question",
"color": "cc317c",
"default": true
},
{
"id": 1008,
"node_id": 1009,
"url": "https://api.github.com/repos/protoEvangelion/gh/labels/test",
"name": "test",
"color": "ededed",
"default": false
}
],
"state": "open",
"locked": false,
"assignee": null,
"assignees": [],
"milestone": null,
"comments": 0,
"created_at": "2017-10-10T16:00:00Z",
"updated_at": "2017-10-10T16:00:00Z",
"closed_at": null,
"author_association": "OWNER",
"body": "msg",
"closed_by": null
},
"rawHeaders": [
"Date",
"Mon, 04 Nov 2019 02:41:29 GMT",
"Content-Type",
"application/json; charset=utf-8",
"Content-Length",
"2304",
"Connection",
"close",
"Server",
"GitHub.com",
"Status",
"201 Created",
"X-RateLimit-Limit",
"5000",
"X-RateLimit-Remaining",
"4853",
"X-RateLimit-Reset",
"1572838595",
"Cache-Control",
"private, max-age=60, s-maxage=60",
"Vary",
"Accept, Authorization, Cookie, X-GitHub-OTP",
"ETag",
"\"7fb12dee548cdf95e7d9f343a11ae1df\"",
"X-OAuth-Scopes",
"user, public_repo, repo, repo:status, delete_repo, gist",
"X-Accepted-OAuth-Scopes",
"",
"Location",
"https://api.github.com/repos/protoEvangelion/gh/issues/132",
"X-GitHub-Media-Type",
"github.v3; format=json",
"Access-Control-Expose-Headers",
"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
"Access-Control-Allow-Origin",
"*",
"Strict-Transport-Security",
"max-age=31536000; includeSubdomains; preload",
"X-Frame-Options",
"deny",
"X-Content-Type-Options",
"nosniff",
"X-XSS-Protection",
"1; mode=block",
"Referrer-Policy",
"origin-when-cross-origin, strict-origin-when-cross-origin",
"Content-Security-Policy",
"default-src 'none'",
"Vary",
"Accept-Encoding",
"X-GitHub-Request-Id",
"DD02:5DFC:2F800C6:3823911:5DBF8FD9"
]
}
]

0 comments on commit c51b481

Please sign in to comment.