Skip to content

Commit 2351727

Browse files
authored
Merge pull request #278 from conveyal/dev
Next release
2 parents 9fe778b + f7bbb71 commit 2351727

File tree

8 files changed

+694
-587
lines changed

8 files changed

+694
-587
lines changed

.travis.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
sudo: false
22
language: node_js
33
cache:
4-
directories:
5-
- ~/.yarn-cache
4+
yarn: true
65
notifications:
76
email: false
87
node_js:
98
- '10'
10-
before_install:
11-
- npm i -g codecov yarn
129
install:
1310
- yarn
1411
script:
1512
- yarn run lint
1613
- yarn run flow
1714
- yarn run cover
18-
- codecov
1915
after_success:
20-
- yarn run semantic-release
16+
- bash <(curl -s https://codecov.io/bash)
17+
- semantic-release
2118
branches:
2219
except:
2320
- /^v\d+\.\d+\.\d+$/

__tests__/lib/build.js

-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
// @flow
2-
// Polyfills to support IE, etc.
3-
// Note: I attempted to update to core-js@3, but ran into issues about ES6
4-
// imports. core-js@2 does not have core-js/stable, which is why we're importing
5-
// the root.
6-
// $FlowFixMe - import required for babel polyfill, see https://babeljs.io/docs/en/babel-polyfill
7-
import 'core-js'
8-
// $FlowFixMe - import required for babel polyfill, see https://babeljs.io/docs/en/babel-polyfill
9-
import 'regenerator-runtime/runtime'
10-
// Imports for test
112
const build = require('../../lib/build')
123
const loadConfig = require('../../lib/load-config')
134
const util = require('../test-utils/util.js')

__tests__/lib/jest.js

+4
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ describe('jest.js', () => {
2626
const indexWithYaml = require('../test-utils/mocks/index-with-yaml')
2727
expect(indexWithYaml).toBeTruthy()
2828
})
29+
30+
it('should be able to perform an async test', async () => {
31+
await Promise.resolve()
32+
})
2933
})

__tests__/test-utils/mocks/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export default class MockTestComponentUniqueName extends Component {
1111
test: 'hi'
1212
}
1313

14+
doSomeFancyAsyncThingy = async () => {
15+
await Promise.resolve('hi')
16+
}
17+
1418
/**
1519
* Render the component.
1620
*/

lib/babel-config.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ const addExports = require('babel-plugin-add-module-exports')
22
const babelEnv = require('@babel/preset-env')
33
const flow = require('@babel/preset-flow')
44
const react = require('@babel/preset-react')
5-
const reactRequire = require('babel-plugin-react-require').default
5+
const istanbul = require('babel-plugin-istanbul')
66
const lodash = require('babel-plugin-lodash')
7-
const reactDisplayName = require('@babel/plugin-transform-react-display-name')
7+
const reactRequire = require('babel-plugin-react-require').default
88
const classProperties = require('@babel/plugin-proposal-class-properties')
99
const exportFrom = require('@babel/plugin-proposal-export-namespace-from')
10-
const istanbul = require('babel-plugin-istanbul')
11-
10+
const reactDisplayName = require('@babel/plugin-transform-react-display-name')
1211
const browsers = require('./constants').BROWSER_SUPPORT
1312

1413
module.exports = function (env, instrument) {
@@ -31,7 +30,11 @@ module.exports = function (env, instrument) {
3130
{
3231
loose: false, // Loose mode breaks spread operator on `Set`s
3332
targets: { browsers },
34-
useBuiltIns: 'entry'
33+
// `usage` value useBuiltIns will automatically require corejs without
34+
// us having to include this import in each project (which is what
35+
// `entry` does).
36+
useBuiltIns: 'usage',
37+
corejs: 3
3538
}
3639
],
3740
flow,

lib/jest-preprocessor.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const babel = require('babel-core')
1+
const {transform} = require('@babel/core')
22

33
const babelCfg = require('./babel-config')
44
const transformCfg = babelCfg('test')
55
transformCfg.retainLines = true
66

77
module.exports = {
88
process: function (src) {
9-
return babel.transform(src, transformCfg).code
9+
return transform(src, transformCfg).code
1010
}
1111
}

package.json

+7-9
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
"mastarm-test": "bin/mastarm-test"
2020
},
2121
"scripts": {
22-
"cover": "bin/mastarm test --env test --test-environment node --coverage --coverage-paths bin",
22+
"cover": "yarn run jest --coverage --coverage-paths bin",
2323
"flow": "bin/mastarm flow",
24+
"jest": "bin/mastarm test --run-in-band --env test --test-environment node",
2425
"lint": "bin/mastarm lint lib __tests__",
25-
"semantic-release": "semantic-release",
2626
"pretest": "yarn",
27-
"test": "bin/mastarm lint lib __tests__ && bin/mastarm test --run-in-band --env test --test-environment node"
27+
"test": "yarn run lint && yarn run flow && yarn run jest"
2828
},
2929
"repository": {
3030
"type": "git",
@@ -48,13 +48,11 @@
4848
"@babel/plugin-proposal-export-namespace-from": "^7.2.0",
4949
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
5050
"@babel/plugin-transform-react-display-name": "^7.2.0",
51-
"@babel/polyfill": "^7.2.5",
52-
"@babel/preset-env": "^7.3.4",
51+
"@babel/preset-env": "^7.5.5",
5352
"@babel/preset-flow": "^7.0.0",
5453
"@babel/preset-react": "^7.0.0",
55-
"@babel/runtime": "^7.3.4",
54+
"@babel/runtime-corejs3": "^7.5.5",
5655
"aws-sdk": "^2.414.0",
57-
"babel-core": "^7.0.0-bridge.0",
5856
"babel-eslint": "^10.0.1",
5957
"babel-jest": "^24.1.0",
6058
"babel-plugin-add-module-exports": "^1.0.0",
@@ -70,7 +68,7 @@
7068
"commander": "^2.19.0",
7169
"commitizen": "^3.0.7",
7270
"concat-stream": "^2.0.0",
73-
"core-js": "2",
71+
"core-js": "3",
7472
"cssnano": "^4.1.10",
7573
"cz-conventional-changelog": "^2.1.0",
7674
"envify": "^4.1.0",
@@ -103,7 +101,7 @@
103101
"postcss-preset-env": "^6.6.0",
104102
"postcss-reporter": "^6.0.1",
105103
"postcss-safe-parser": "^4.0.1",
106-
"prettier-eslint-cli": "^4.7.1",
104+
"prettier-eslint-cli": "^5.0.0",
107105
"rimraf": "^2.6.3",
108106
"slack-node": "^0.1.8",
109107
"sshpk": "^1.16.1",

0 commit comments

Comments
 (0)