Skip to content

Commit

Permalink
breaking: update to latest jest (#190)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Changed from babel `es2015` and `stage-2` presets to `babel-preset-env`, so for certain browsers support might have changed. Though currently the support is aligned with our supported browsers.

* Update to latest jest

* Add editorconfig

* Remove ignored tests

* Update api test

* Update ModelBase test

* Update Model tests

* Add back babel-loader

* Update remaining model tests

* Unignore remaining tests

* Remove done callback from tests

* Remove validate npm script

* Fix unhandled promise rejection for Pager test

* Fix unhandled promise rejection for ModelValidation test

* Fix deprecated buffer usage

* Bump node version

* Remove eslint disable lines

* Update SystemConfiguration tests

* Fix eslintrc trailing newline

* Fix trailing spaces

* Revert to original error handling style

* Remove unnecessary catch
  • Loading branch information
ismay authored Feb 27, 2019
1 parent 5081199 commit 6a9deca
Show file tree
Hide file tree
Showing 61 changed files with 3,586 additions and 2,410 deletions.
24 changes: 18 additions & 6 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"presets": ["es2015", "stage-2"],
"env": {
"test": {
"presets": ["es2015", "stage-2"],
}
},
"presets": [
"@babel/preset-env"
],
"plugins": ["@babel/plugin-proposal-class-properties"],
"env": {
"test": {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current",
}
},
]
]
}
}
}
5 changes: 5 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
> 0.5%
last 2 versions
Firefox ESR
ie 11
not dead
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# For more information about the properties used in
# this file, please see the EditorConfig documentation:
# https://editorconfig.org/

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- 8
- 10
before_script:
- npm install --global @dhis2/deploy-build
script:
Expand Down
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,20 @@
"whatwg-fetch": "^2.0.3"
},
"devDependencies": {
"babel-cli": "^6.24.0",
"babel-core": "^6.24.0",
"babel-eslint": "^7.2.3",
"babel-jest": "^22.4.3",
"babel-loader": "^7.0.0",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.24.0",
"babel-preset-stage-2": "^6.18.0",
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.3",
"@babel/plugin-proposal-class-properties": "^7.3.3",
"@babel/preset-env": "^7.3.1",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.5",
"canonical-path": "0.0.2",
"codeclimate-test-reporter": "^0.4.1",
"docdash": "^0.4.0",
"eslint-config-dhis2": "^3.0.2",
"esprima": "^3.1.3",
"form-data": "^2.1.2",
"isomorphic-fetch": "^2.2.1",
"jest": "^21.0.2",
"jest": "^24.1.0",
"jsdoc": "^3.5.5",
"karma-cli": "^1.0.1",
"lodash": "^4.17.4",
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/Config_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Config', () => {
});

it('should not be allowed to call as function', () => {
expect(() => Config()).toThrowError(); // eslint-disable-line
expect(() => Config()).toThrowError();
});

describe('processConfigForD2', () => {
Expand Down
Loading

0 comments on commit 6a9deca

Please sign in to comment.