Skip to content

Commit

Permalink
Merge pull request #278 from conveyal/dev
Browse files Browse the repository at this point in the history
Next release
  • Loading branch information
evansiroky authored Jul 25, 2019
2 parents 9fe778b + f7bbb71 commit 2351727
Show file tree
Hide file tree
Showing 8 changed files with 694 additions and 587 deletions.
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
sudo: false
language: node_js
cache:
directories:
- ~/.yarn-cache
yarn: true
notifications:
email: false
node_js:
- '10'
before_install:
- npm i -g codecov yarn
install:
- yarn
script:
- yarn run lint
- yarn run flow
- yarn run cover
- codecov
after_success:
- yarn run semantic-release
- bash <(curl -s https://codecov.io/bash)
- semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/
9 changes: 0 additions & 9 deletions __tests__/lib/build.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
// @flow
// Polyfills to support IE, etc.
// Note: I attempted to update to core-js@3, but ran into issues about ES6
// imports. core-js@2 does not have core-js/stable, which is why we're importing
// the root.
// $FlowFixMe - import required for babel polyfill, see https://babeljs.io/docs/en/babel-polyfill
import 'core-js'
// $FlowFixMe - import required for babel polyfill, see https://babeljs.io/docs/en/babel-polyfill
import 'regenerator-runtime/runtime'
// Imports for test
const build = require('../../lib/build')
const loadConfig = require('../../lib/load-config')
const util = require('../test-utils/util.js')
Expand Down
4 changes: 4 additions & 0 deletions __tests__/lib/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ describe('jest.js', () => {
const indexWithYaml = require('../test-utils/mocks/index-with-yaml')
expect(indexWithYaml).toBeTruthy()
})

it('should be able to perform an async test', async () => {
await Promise.resolve()
})
})
4 changes: 4 additions & 0 deletions __tests__/test-utils/mocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export default class MockTestComponentUniqueName extends Component {
test: 'hi'
}

doSomeFancyAsyncThingy = async () => {
await Promise.resolve('hi')
}

/**
* Render the component.
*/
Expand Down
13 changes: 8 additions & 5 deletions lib/babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ const addExports = require('babel-plugin-add-module-exports')
const babelEnv = require('@babel/preset-env')
const flow = require('@babel/preset-flow')
const react = require('@babel/preset-react')
const reactRequire = require('babel-plugin-react-require').default
const istanbul = require('babel-plugin-istanbul')
const lodash = require('babel-plugin-lodash')
const reactDisplayName = require('@babel/plugin-transform-react-display-name')
const reactRequire = require('babel-plugin-react-require').default
const classProperties = require('@babel/plugin-proposal-class-properties')
const exportFrom = require('@babel/plugin-proposal-export-namespace-from')
const istanbul = require('babel-plugin-istanbul')

const reactDisplayName = require('@babel/plugin-transform-react-display-name')
const browsers = require('./constants').BROWSER_SUPPORT

module.exports = function (env, instrument) {
Expand All @@ -31,7 +30,11 @@ module.exports = function (env, instrument) {
{
loose: false, // Loose mode breaks spread operator on `Set`s
targets: { browsers },
useBuiltIns: 'entry'
// `usage` value useBuiltIns will automatically require corejs without
// us having to include this import in each project (which is what
// `entry` does).
useBuiltIns: 'usage',
corejs: 3
}
],
flow,
Expand Down
4 changes: 2 additions & 2 deletions lib/jest-preprocessor.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const babel = require('babel-core')
const {transform} = require('@babel/core')

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

module.exports = {
process: function (src) {
return babel.transform(src, transformCfg).code
return transform(src, transformCfg).code
}
}
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
"mastarm-test": "bin/mastarm-test"
},
"scripts": {
"cover": "bin/mastarm test --env test --test-environment node --coverage --coverage-paths bin",
"cover": "yarn run jest --coverage --coverage-paths bin",
"flow": "bin/mastarm flow",
"jest": "bin/mastarm test --run-in-band --env test --test-environment node",
"lint": "bin/mastarm lint lib __tests__",
"semantic-release": "semantic-release",
"pretest": "yarn",
"test": "bin/mastarm lint lib __tests__ && bin/mastarm test --run-in-band --env test --test-environment node"
"test": "yarn run lint && yarn run flow && yarn run jest"
},
"repository": {
"type": "git",
Expand All @@ -48,13 +48,11 @@
"@babel/plugin-proposal-export-namespace-from": "^7.2.0",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-transform-react-display-name": "^7.2.0",
"@babel/polyfill": "^7.2.5",
"@babel/preset-env": "^7.3.4",
"@babel/preset-env": "^7.5.5",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@babel/runtime": "^7.3.4",
"@babel/runtime-corejs3": "^7.5.5",
"aws-sdk": "^2.414.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.1.0",
"babel-plugin-add-module-exports": "^1.0.0",
Expand All @@ -70,7 +68,7 @@
"commander": "^2.19.0",
"commitizen": "^3.0.7",
"concat-stream": "^2.0.0",
"core-js": "2",
"core-js": "3",
"cssnano": "^4.1.10",
"cz-conventional-changelog": "^2.1.0",
"envify": "^4.1.0",
Expand Down Expand Up @@ -103,7 +101,7 @@
"postcss-preset-env": "^6.6.0",
"postcss-reporter": "^6.0.1",
"postcss-safe-parser": "^4.0.1",
"prettier-eslint-cli": "^4.7.1",
"prettier-eslint-cli": "^5.0.0",
"rimraf": "^2.6.3",
"slack-node": "^0.1.8",
"sshpk": "^1.16.1",
Expand Down
Loading

0 comments on commit 2351727

Please sign in to comment.