Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
v0.9.0 – babel presets, test fix and browserslist addition (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleynolan authored and DamianMullins committed Jan 30, 2018
1 parent 850a0d3 commit baf76d0
Show file tree
Hide file tree
Showing 7 changed files with 1,502 additions and 858 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["es2015"]
"presets": ["env"]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ nbproject
Thumbs.db
logs
*.log
.yalc
yalc.lock
package-lock.json

dist/
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).


v0.9.0
------------------------------
*January 30, 2018*

### Added
- Browserslist added

### Changed
- Package update for `gulp-build-fozzie`
- Updating the babel config

### Fixed
- Fixed test warning for js-dom on `submit` (as it doesn't handle submit events)


v0.8.2
------------------------------
*January 26, 2018*
Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { build } = require('@justeat/gulp-build-fozzie');

build(gulp, {
js: {
jsDir: '',
lintPaths: ['{src,test}/**/*.js']
}
});
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@justeat/f-validate",
"description": "Fozzie vanilla JS Validation Component",
"version": "0.8.2",
"version": "0.9.0",
"main": "dist/index.js",
"files": [
"dist"
Expand All @@ -22,12 +22,12 @@
"node": ">=4.0.0"
},
"dependencies": {
"@justeat/f-dom": "^0.1.2"
"@justeat/f-dom": "^0.2.0"
},
"devDependencies": {
"@justeat/gulp-build-fozzie": "^6.5.0",
"@justeat/gulp-build-fozzie": "^7.6.0",
"babel-cli": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-env": "^1.6.1",
"concurrently": "^3.5.1",
"coveralls": "^3.0.0",
"gulp": "^3.9.1",
Expand All @@ -43,5 +43,11 @@
"test": "gulp scripts:test:coverage",
"test:watch": "jest --coverage --watch",
"test:coveralls": "cat coverage/lcov.info | coveralls"
}
},
"browserslist": [
"> 5%",
"last 2 versions",
"Safari >= 8",
"not ie 10"
]
}
4 changes: 4 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,16 @@ describe('on submit', () => {
const button = form.querySelector('button');
new FormValidation(form); // eslint-disable-line no-new

const mockHandler = jest.fn(e => { e.preventDefault(); });
form.addEventListener('submit', mockHandler);

// Act
TestUtils.click(button);

// Assert
const html = TestUtils.getBodyHtml();
expect(html).toMatchSnapshot();
expect(mockHandler).toHaveBeenCalled();

});

Expand Down
Loading

0 comments on commit baf76d0

Please sign in to comment.