Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit d415987

Browse files
authored
Merge pull request #66 from jaebradley/upgrade-v1
Upgrade V1
2 parents 05b2390 + 22f4f41 commit d415987

File tree

93 files changed

+15122
-3246
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+15122
-3246
lines changed

.babelrc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
{
2-
"presets": ["es2015", "stage-0"]
2+
"presets": [
3+
"@babel/preset-env"
4+
],
5+
"env": {
6+
"production": {
7+
"presets": [
8+
"minify"
9+
]
10+
}
11+
},
12+
"plugins": [
13+
"@babel/plugin-transform-runtime"
14+
],
15+
"ignore": [
16+
"node_modules",
17+
"*.test.js"
18+
]
319
}

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage/*
2+
build
3+
node_modules

.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "airbnb-base",
3+
"env": {
4+
"jest": true
5+
}
6+
}
7+

.eslintrc.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

.gitignore

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,62 @@
1-
node_modules/*
2-
npm-debug.log
3-
coverage/
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (http://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# Typescript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+
460
build/
5-
package-lock.json
61+
62+
.DS_Store

.npmignore

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
1-
src/
1+
node_modules/**
2+
3+
src/**
4+
test/**
5+
coverage/**
6+
7+
npm-debug.log
8+
commitlint.config.js
9+
*.test.js
10+
**/__mocks__/**
11+
12+
.DS_Store
13+
.eslintcache
14+
.travis.yml
15+
.babelrc
16+
.eslintignore
17+
.eslintrc

.travis.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
language: node_js
2+
cache:
3+
directories:
4+
- ~/.npm
5+
notifications:
6+
email: true
27
node_js:
3-
- 4.2.2
4-
sudo: false
5-
script:
6-
- npm run build
8+
- '8'
9+
install: npm install
10+
before_install:
11+
- npm install -g npm@5
12+
- npm install -g greenkeeper-lockfile@1
13+
jobs:
14+
include:
15+
- stage: test
16+
script:
17+
- npm run build
18+
- npm run lint
19+
- npm run test
20+
before_script: greenkeeper-lockfile-update
21+
after_script: greenkeeper-lockfile-upload
22+
after_success: npm run codecov
23+
- stage: deploy
24+
if: branch = master
25+
script: npm run travis-deploy-once "npm run semantic-release"

__mocks__/@google/maps.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const geocode = jest.fn(({ address }) => ({
2+
asPromise: () => {
3+
if (address === 'jaebaebae') {
4+
return Promise.resolve({
5+
json: {
6+
results: [{
7+
formatted_address: 'formatted address',
8+
geometry: {
9+
location: {
10+
lat: 'latitude',
11+
lng: 'longitude',
12+
},
13+
},
14+
}],
15+
},
16+
});
17+
}
18+
19+
return Promise.resolve({ json: { results: [] } });
20+
},
21+
}));
22+
23+
const createClient = jest.fn(() => ({ geocode }));
24+
25+
export default { createClient };
26+
export { geocode };

__mocks__/convert-units.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const to = jest.fn(() => 1234);
2+
3+
const from = jest.fn(() => ({ to }));
4+
5+
const constructor = jest.fn(() => ({ from }));
6+
7+
const convert = constructor;
8+
9+
export default convert;
10+
11+
export {
12+
to,
13+
from,
14+
};

__mocks__/uber-estimates-client.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
const getExpectedTimeOfArrival = jest.fn(() => ({
2+
times: [
3+
{
4+
localized_display_name: 'first localized display name',
5+
estimate: 'first estimate',
6+
},
7+
{
8+
localized_display_name: 'second localized display name',
9+
estimate: 'second estimate',
10+
},
11+
],
12+
}));
13+
14+
const getPrices = jest.fn(() => ({
15+
prices: [
16+
{
17+
localized_display_name: 'first localized display name',
18+
distance: 'first distance',
19+
duration: 'first duration',
20+
high_estimate: 'first high estimate',
21+
low_estimate: 'first low estimate',
22+
currency_code: 'first currency code',
23+
surgeMultiplier: undefined,
24+
},
25+
{
26+
localized_display_name: 'second localized display name',
27+
distance: 'second distance',
28+
duration: 'second duration',
29+
high_estimate: 'second high estimate',
30+
low_estimate: 'second low estimate',
31+
currency_code: 'second currency code',
32+
surgeMultiplier: 'surgeMultiplier',
33+
},
34+
],
35+
}));
36+
37+
const constructor = jest.fn(() => ({
38+
getExpectedTimeOfArrival,
39+
getPrices,
40+
}));
41+
42+
const UberEstimatesClient = constructor;
43+
44+
export default UberEstimatesClient;
45+
export {
46+
getExpectedTimeOfArrival,
47+
getPrices,
48+
};

0 commit comments

Comments
 (0)