Skip to content

Commit 7a16dfe

Browse files
authoredAug 7, 2018
test: add test (#4)
1 parent 3352129 commit 7a16dfe

26 files changed

+3370
-209
lines changed
 

‎.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ install:
1919
script:
2020
- yarn run eslint
2121
- ./tasks/flow-coverage.sh
22-
# - ./node_modules/.bin/lerna run test
22+
- ./node_modules/.bin/lerna run test
2323

2424
after_success:
25-
# - ./node_modules/.bin/codecov
25+
- ./node_modules/.bin/codecov
2626

2727
cache:
2828
yarn: true

‎README.md

+21
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
> Google calendar todo list application with GraphQL proxy.
44
5+
[![Travis][travis-badge]][travis]
6+
[![Codecov Status][codecov-badge]][codecov]
7+
[![license][license-badge]][license]
8+
59
## Demo
610

711
https://calendar-todo-web.now.sh/
@@ -108,3 +112,20 @@ $ docker build -t calendar-todo/web .
108112

109113
Screenshot:
110114
![web](./docs/web.png)
115+
116+
## CONTRIBUTING
117+
118+
- ⇄ Pull requests and ★ Stars are always welcome.
119+
- For bugs and feature requests, please create an issue.
120+
- Pull requests must be accompanied by passing automated tests.
121+
122+
## [LICENSE](LICENSE)
123+
124+
MIT: [http://michaelhsu.mit-license.org](http://michaelhsu.mit-license.org)
125+
126+
[travis-badge]: https://travis-ci.com/evenchange4/calendar-todo.svg?branch=master
127+
[travis]: https://travis-ci.org/evenchange4/calendar-todo
128+
[codecov-badge]: https://img.shields.io/codecov/c/github/evenchange4/calendar-todo.svg?style=flat-square
129+
[codecov]: https://codecov.io/github/evenchange4/calendar-todo?branch=master
130+
[license-badge]: https://img.shields.io/github/license/evenchange4/micro-website-api.svg?style=flat-square
131+
[license]: http://michaelhsu.mit-license.org/

‎flow-typed/npm/nock_v9.x.x.js

-144
This file was deleted.

‎flow-typed/npm/react-apollo_v2.x.x.js

+4
Original file line numberDiff line numberDiff line change
@@ -1019,3 +1019,7 @@ declare module "react-apollo" {
10191019
context?: { [string]: any }
10201020
}> {}
10211021
}
1022+
1023+
declare module 'react-apollo/test-utils' {
1024+
declare module.exports: any;
1025+
}

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"type": [
5858
"text"
5959
],
60-
"threshold": 81
60+
"threshold": 80
6161
},
6262
"eslintConfig": {
6363
"parser": "babel-eslint",

‎packages/server/.env.test

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PORT=4000
22
DEBUG=server
33

4-
GOOGLE_CLIENT_ID=
5-
GOOGLE_CLIENT_SECRET=
6-
GOOGLE_REDIRECT_URL=
4+
GOOGLE_CLIENT_ID=GOOGLE_CLIENT_ID
5+
GOOGLE_CLIENT_SECRET=GOOGLE_CLIENT_SECRET
6+
GOOGLE_REDIRECT_URL=GOOGLE_REDIRECT_URL

‎packages/server/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
"get-port": "4.0.0",
5757
"graphql-request": "1.8.0",
5858
"jest": "23.4.2",
59-
"nock": "9.4.4",
6059
"nodemon": "1.18.3",
6160
"pkg": "4.3.3"
6261
},

‎packages/server/setupTests.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
// @flow
22

33
require('dotenv-safe').load({ path: '.env.test' });
4+
5+
jest.mock('./src/utils/getOauthClient', () => () => ({}));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"data": {
3+
"kind": "calendar#event",
4+
"etag": "\"3067289974868000\"",
5+
"id": "0kv1j0ol9d02ihca1p8qcv5trc",
6+
"status": "confirmed",
7+
"htmlLink": "https://www.google.com/calendar/event?eid=MGt2MWowb2w5ZDAyaWhjYTFwOHFjdjV0cmMgZXZlbmNoYW5nZTNAbQ",
8+
"created": "2018-08-07T00:46:07.000Z",
9+
"updated": "2018-08-07T12:29:47.434Z",
10+
"summary": "Workshop 1: AWS 101 - Introduction to AWS Cloud Computing",
11+
"description": "Join the Introduction in AWS Cloud Computing Workshop and understand the core concepts of “Cloud Computing” plus the different attributes such as reliability, fault tolerance, elasticity, scalability and pay-as-you-go pricing. Whether you are an Enterprise looking for IT innovation, agility and resiliency while reducing costs or small and medium business who wants to accelerate growth without a big upfront investment in cash or time for technology, the AWS Cloud provides a complete set of infrastructure services at zero upfront costs which are available with a few clicks and within minutes.",
12+
"location": "taipei",
13+
"creator": {
14+
"email": "evenchange3@gmail.com",
15+
"self": true
16+
},
17+
"organizer": {
18+
"email": "evenchange3@gmail.com",
19+
"self": true
20+
},
21+
"start": {
22+
"dateTime": "2018-08-07T00:00:00+08:00"
23+
},
24+
"end": {
25+
"dateTime": "2018-08-07T08:00:00+08:00"
26+
},
27+
"iCalUID": "0kv1j0ol9d02ihca1p8qcv5trc@google.com",
28+
"sequence": 0,
29+
"reminders": {
30+
"useDefault": true
31+
}
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"data": {
3+
"items": [
4+
{
5+
"kind": "calendar#event",
6+
"etag": "\"3067268088666000\"",
7+
"id": "sfodsvfr8btnaciku1ktg464m0",
8+
"status": "confirmed",
9+
"htmlLink": "https://www.google.com/calendar/event?eid=c2ZvZHN2ZnI4YnRuYWNpa3Uxa3RnNDY0bTAgZXZlbmNoYW5nZTNAbQ",
10+
"created": "2018-08-07T09:27:24.000Z",
11+
"updated": "2018-08-07T09:27:24.333Z",
12+
"summary": "AWS Online Tech Talks: On-Demand Library",
13+
"description": "Miss a previous tech talk? AWS Online Tech Talks are now available on-demand! Nearly 100 technical discussions and demos, ready when you are.",
14+
"location": "Taipei",
15+
"creator": {
16+
"email": "evenchange3@gmail.com",
17+
"self": true
18+
},
19+
"organizer": {
20+
"email": "evenchange3@gmail.com",
21+
"self": true
22+
},
23+
"start": {
24+
"dateTime": "2018-08-07T17:27:12+08:00"
25+
},
26+
"end": {
27+
"dateTime": "2018-08-07T17:27:12+08:00"
28+
},
29+
"iCalUID": "sfodsvfr8btnaciku1ktg464m0@google.com",
30+
"sequence": 0,
31+
"reminders": {
32+
"useDefault": true
33+
}
34+
},
35+
{
36+
"kind": "calendar#event",
37+
"etag": "\"3067289974868000\"",
38+
"id": "0kv1j0ol9d02ihca1p8qcv5trc",
39+
"status": "confirmed",
40+
"htmlLink": "https://www.google.com/calendar/event?eid=MGt2MWowb2w5ZDAyaWhjYTFwOHFjdjV0cmMgZXZlbmNoYW5nZTNAbQ",
41+
"created": "2018-08-07T00:46:07.000Z",
42+
"updated": "2018-08-07T12:29:47.434Z",
43+
"summary": "Workshop 1: AWS 101 - Introduction to AWS Cloud Computing",
44+
"description": "Join the Introduction in AWS Cloud Computing Workshop and understand the core concepts of “Cloud Computing” plus the different attributes such as reliability, fault tolerance, elasticity, scalability and pay-as-you-go pricing. Whether you are an Enterprise looking for IT innovation, agility and resiliency while reducing costs or small and medium business who wants to accelerate growth without a big upfront investment in cash or time for technology, the AWS Cloud provides a complete set of infrastructure services at zero upfront costs which are available with a few clicks and within minutes.",
45+
"location": "taipei",
46+
"creator": {
47+
"email": "evenchange3@gmail.com",
48+
"self": true
49+
},
50+
"organizer": {
51+
"email": "evenchange3@gmail.com",
52+
"self": true
53+
},
54+
"start": {
55+
"dateTime": "2018-08-07T00:00:00+08:00"
56+
},
57+
"end": {
58+
"dateTime": "2018-08-07T08:00:00+08:00"
59+
},
60+
"iCalUID": "0kv1j0ol9d02ihca1p8qcv5trc@google.com",
61+
"sequence": 0,
62+
"reminders": {
63+
"useDefault": true
64+
}
65+
}
66+
]
67+
}
68+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`rest modules query Events 1`] = `
4+
Object {
5+
"event": Object {
6+
"description": "Join the Introduction in AWS Cloud Computing Workshop and understand the core concepts of “Cloud Computing” plus the different attributes such as reliability, fault tolerance, elasticity, scalability and pay-as-you-go pricing. Whether you are an Enterprise looking for IT innovation, agility and resiliency while reducing costs or small and medium business who wants to accelerate growth without a big upfront investment in cash or time for technology, the AWS Cloud provides a complete set of infrastructure services at zero upfront costs which are available with a few clicks and within minutes.",
7+
"end": Object {
8+
"dateTime": "2018-08-07T08:00:00+08:00",
9+
},
10+
"htmlLink": "https://www.google.com/calendar/event?eid=MGt2MWowb2w5ZDAyaWhjYTFwOHFjdjV0cmMgZXZlbmNoYW5nZTNAbQ",
11+
"id": "0kv1j0ol9d02ihca1p8qcv5trc",
12+
"location": "taipei",
13+
"start": Object {
14+
"dateTime": "2018-08-07T00:00:00+08:00",
15+
},
16+
"summary": "Workshop 1: AWS 101 - Introduction to AWS Cloud Computing",
17+
},
18+
}
19+
`;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`rest modules query Events 1`] = `
4+
Object {
5+
"events": Array [
6+
Object {
7+
"id": "sfodsvfr8btnaciku1ktg464m0",
8+
"location": "Taipei",
9+
"summary": "AWS Online Tech Talks: On-Demand Library",
10+
},
11+
Object {
12+
"id": "0kv1j0ol9d02ihca1p8qcv5trc",
13+
"location": "taipei",
14+
"summary": "Workshop 1: AWS 101 - Introduction to AWS Cloud Computing",
15+
},
16+
],
17+
}
18+
`;

0 commit comments

Comments
 (0)
Please sign in to comment.