Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: begin implementing basic tests #148

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__tests__/**
testenv.js
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ cache:
directories:
- node_modules
node_js:
- '7'
- 7
before_script:
- 'yarn'
- yarn
script:
- yarn run test
- yarn run eslint
151 changes: 151 additions & 0 deletions __tests__/data/issue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
export const open = {
url: 'https://api.github.com/repos/gitpoint/git-point/issues/144',
repository_url: 'https://api.github.com/repos/gitpoint/git-point',
labels_url:
'https://api.github.com/repos/gitpoint/git-point/issues/144/labels{/name}',
comments_url:
'https://api.github.com/repos/gitpoint/git-point/issues/144/comments',
events_url:
'https://api.github.com/repos/gitpoint/git-point/issues/144/events',
html_url: 'https://github.com/gitpoint/git-point/pull/144',
id: 244830380,
number: 144,
title: 'Show actual version of the application',
user: {
login: 'lex111',
id: 4408379,
avatar_url: 'https://avatars2.githubusercontent.com/u/4408379?v=4',
gravatar_id: '',
url: 'https://api.github.com/users/lex111',
html_url: 'https://github.com/lex111',
followers_url: 'https://api.github.com/users/lex111/followers',
following_url: 'https://api.github.com/users/lex111/following{/other_user}',
gists_url: 'https://api.github.com/users/lex111/gists{/gist_id}',
starred_url: 'https://api.github.com/users/lex111/starred{/owner}{/repo}',
subscriptions_url: 'https://api.github.com/users/lex111/subscriptions',
organizations_url: 'https://api.github.com/users/lex111/orgs',
repos_url: 'https://api.github.com/users/lex111/repos',
events_url: 'https://api.github.com/users/lex111/events{/privacy}',
received_events_url: 'https://api.github.com/users/lex111/received_events',
type: 'User',
site_admin: false,
},
labels: [],
state: 'open',
locked: false,
assignee: null,
assignees: [],
milestone: null,
comments: 0,
created_at: '2017-07-22T07:21:23Z',
updated_at: '2017-07-22T17:03:14Z',
closed_at: '2017-07-22T16:52:21Z',
author_association: 'MEMBER',
pull_request: {
url: 'https://api.github.com/repos/gitpoint/git-point/pulls/144',
html_url: 'https://github.com/gitpoint/git-point/pull/144',
diff_url: 'https://github.com/gitpoint/git-point/pull/144.diff',
patch_url: 'https://github.com/gitpoint/git-point/pull/144.patch',
},
body:
"Now the version of the application is hardcoded, which is not good, it's best practice to specify the version number in the `package.json` file and from there take it to display.",
closed_by: {
login: 'housseindjirdeh',
id: 12476932,
avatar_url: 'https://avatars3.githubusercontent.com/u/12476932?v=4',
gravatar_id: '',
url: 'https://api.github.com/users/housseindjirdeh',
html_url: 'https://github.com/housseindjirdeh',
followers_url: 'https://api.github.com/users/housseindjirdeh/followers',
following_url:
'https://api.github.com/users/housseindjirdeh/following{/other_user}',
gists_url: 'https://api.github.com/users/housseindjirdeh/gists{/gist_id}',
starred_url:
'https://api.github.com/users/housseindjirdeh/starred{/owner}{/repo}',
subscriptions_url:
'https://api.github.com/users/housseindjirdeh/subscriptions',
organizations_url: 'https://api.github.com/users/housseindjirdeh/orgs',
repos_url: 'https://api.github.com/users/housseindjirdeh/repos',
events_url: 'https://api.github.com/users/housseindjirdeh/events{/privacy}',
received_events_url:
'https://api.github.com/users/housseindjirdeh/received_events',
type: 'User',
site_admin: false,
},
};

export const closed = {
url: 'https://api.github.com/repos/gitpoint/git-point/issues/144',
repository_url: 'https://api.github.com/repos/gitpoint/git-point',
labels_url:
'https://api.github.com/repos/gitpoint/git-point/issues/144/labels{/name}',
comments_url:
'https://api.github.com/repos/gitpoint/git-point/issues/144/comments',
events_url:
'https://api.github.com/repos/gitpoint/git-point/issues/144/events',
html_url: 'https://github.com/gitpoint/git-point/pull/144',
id: 244830380,
number: 144,
title: 'Show actual version of the application',
user: {
login: 'lex111',
id: 4408379,
avatar_url: 'https://avatars2.githubusercontent.com/u/4408379?v=4',
gravatar_id: '',
url: 'https://api.github.com/users/lex111',
html_url: 'https://github.com/lex111',
followers_url: 'https://api.github.com/users/lex111/followers',
following_url: 'https://api.github.com/users/lex111/following{/other_user}',
gists_url: 'https://api.github.com/users/lex111/gists{/gist_id}',
starred_url: 'https://api.github.com/users/lex111/starred{/owner}{/repo}',
subscriptions_url: 'https://api.github.com/users/lex111/subscriptions',
organizations_url: 'https://api.github.com/users/lex111/orgs',
repos_url: 'https://api.github.com/users/lex111/repos',
events_url: 'https://api.github.com/users/lex111/events{/privacy}',
received_events_url: 'https://api.github.com/users/lex111/received_events',
type: 'User',
site_admin: false,
},
labels: [],
state: 'closed',
locked: false,
assignee: null,
assignees: [],
milestone: null,
comments: 0,
created_at: '2017-07-22T07:21:23Z',
updated_at: '2017-07-22T17:03:14Z',
closed_at: '2017-07-22T16:52:21Z',
author_association: 'MEMBER',
pull_request: {
url: 'https://api.github.com/repos/gitpoint/git-point/pulls/144',
html_url: 'https://github.com/gitpoint/git-point/pull/144',
diff_url: 'https://github.com/gitpoint/git-point/pull/144.diff',
patch_url: 'https://github.com/gitpoint/git-point/pull/144.patch',
},
body:
"Now the version of the application is hardcoded, which is not good, it's best practice to specify the version number in the `package.json` file and from there take it to display.",
closed_by: {
login: 'housseindjirdeh',
id: 12476932,
avatar_url: 'https://avatars3.githubusercontent.com/u/12476932?v=4',
gravatar_id: '',
url: 'https://api.github.com/users/housseindjirdeh',
html_url: 'https://github.com/housseindjirdeh',
followers_url: 'https://api.github.com/users/housseindjirdeh/followers',
following_url:
'https://api.github.com/users/housseindjirdeh/following{/other_user}',
gists_url: 'https://api.github.com/users/housseindjirdeh/gists{/gist_id}',
starred_url:
'https://api.github.com/users/housseindjirdeh/starred{/owner}{/repo}',
subscriptions_url:
'https://api.github.com/users/housseindjirdeh/subscriptions',
organizations_url: 'https://api.github.com/users/housseindjirdeh/orgs',
repos_url: 'https://api.github.com/users/housseindjirdeh/repos',
events_url: 'https://api.github.com/users/housseindjirdeh/events{/privacy}',
received_events_url:
'https://api.github.com/users/housseindjirdeh/received_events',
type: 'User',
site_admin: false,
},
};
4 changes: 4 additions & 0 deletions __tests__/data/label.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
name: 'test tag',
color: 'c3c3c3',
};
36 changes: 36 additions & 0 deletions __tests__/data/organization.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
export default {
login: 'github',
id: 1,
url: 'https://api.github.com/orgs/github',
repos_url: 'https://api.github.com/orgs/github/repos',
events_url: 'https://api.github.com/orgs/github/events',
hooks_url: 'https://api.github.com/orgs/github/hooks',
issues_url: 'https://api.github.com/orgs/github/issues',
members_url: 'https://api.github.com/orgs/github/members{/member}',
public_members_url:
'https://api.github.com/orgs/github/public_members{/member}',
avatar_url: 'https://github.com/images/error/octocat_happy.gif',
description: 'A great organization',
name: 'github',
blog: 'https://github.com/blog',
location: 'San Francisco',
email: 'octocat@github.com',
public_repos: 2,
public_gists: 1,
html_url: 'https://github.com/octocat',
created_at: '2008-01-14T04:33:35Z',
type: 'Organization',
total_private_repos: 100,
owned_private_repos: 100,
private_gists: 81,
disk_usage: 10000,
collaborators: 8,
billing_email: 'support@github.com',
plan: {
name: 'Medium',
space: 400,
private_repos: 20,
},
default_repository_settings: 'read',
members_can_create_repositories: true,
};
Loading