Skip to content

Commit

Permalink
fix: Upgraded project development environment to babel 7 and webpack 4 (
Browse files Browse the repository at this point in the history
#1505)

* Upgraded project development environment to babel 7 and webpack 4
* Removed unused advisories exceptions from .nsprc
* Added package-lock.json to the git repo
* Re-run functional tests once when failing on travis windows workers
* Add test case for uncovered lines detected by nyc
  • Loading branch information
rpl authored Feb 20, 2019
1 parent a9b9a76 commit 5d2dfb4
Show file tree
Hide file tree
Showing 22 changed files with 13,531 additions and 100 deletions.
25 changes: 14 additions & 11 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
{
"presets": ["es2015", "stage-2"],
"presets": [
["@babel/env", {
"targets": {"node": "8"}
}],
"@babel/flow"
],
"plugins": [
"transform-flow-strip-types",
"transform-class-properties",
"transform-es2015-modules-commonjs",
[
"transform-runtime", {
"polyfill": false,
"regenerator": true
}
]
]
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-runtime"
],
"env": {
"test": {
"plugins": [ "istanbul" ]
}
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
.cache

# Build artifacts.
.nyc_output
npm-debug.log
node_modules
dist/*
artifacts/*
coverage/*
package-lock.json
8 changes: 1 addition & 7 deletions .nsprc
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{
"exceptions": [
"https://npmjs.com/advisories/118",
"https://npmjs.com/advisories/577",
"https://npmjs.com/advisories/612",
"https://npmjs.com/advisories/678",
"https://npmjs.com/advisories/720",
"https://npmjs.com/advisories/725",
"https://npmjs.com/advisories/745",
"https://npmjs.com/advisories/782",
"https://npmjs.com/advisories/786"
"https://npmjs.com/advisories/782"
]
}
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,21 @@ jobs:

script:
## run eslint, flow and the unit test suite.
- COVERAGE=y NODE_ENV=production npm test
- npm run test-coverage

## NOTE: by setting the configured python to /bin/false we are forcing the production mode tests
## to fail if any of the dependencies is a binary dependency that is build using node-gyp.
- npm config set python /bin/false

## run functional test suite in a npm production environment
## (See #1082 for rationale).
- NODE_ENV=production npm run build
- npm run copy-dist-files-to-artifacts-dir
- cd artifacts/production
- npm install --production; export NPM_INSTALL_EXIT_CODE=$?
- cd -
- test $NPM_INSTALL_EXIT_CODE -eq 0 &&
TEST_WEB_EXT_BIN=./artifacts/production/bin/web-ext npm run test:functional
TEST_WEB_EXT_BIN=./artifacts/production/bin/web-ext node scripts/test-functional

## NOTE: remove the custom python path from the npm config, and also
## remove production package.json (which seems to convince npm run travlis-pr-title-lint
Expand Down
9 changes: 1 addition & 8 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,10 @@ module.exports = function(grunt) {
'webpack:build',
]);

grunt.registerTask('build-tests', [
'build',
'webpack:unit_tests',
'webpack:functional_tests',
]);

grunt.registerTask('test', 'run linting and the unit test suite', function() {
var tasks = [
'lint',
'flowbin:check',
'build-tests',
'mochaTest:unit',
];

Expand All @@ -47,7 +40,7 @@ module.exports = function(grunt) {
});

grunt.registerTask('test:functional', 'run functional test suites', [
'build-tests',
'build',
'mochaTest:functional',
]);

Expand Down
Loading

0 comments on commit 5d2dfb4

Please sign in to comment.