Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/karma unit test #8

Merged
merged 12 commits into from
Nov 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"plugins": [
"@babel/plugin-proposal-object-rest-spread",
[
"istanbul",
{
"exclude": [
"**/*.spec.js"
]
}
]
],
"presets": [
[
"@babel/preset-env",
{
"modules": false,
"exclude": [
"transform-regenerator"
],
"targets": {
"browsers": [
"last 2 versions",
"safari >= 7"
]
}
}
]
]
}
6 changes: 2 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:10
- image: circleci/node:9.8.0-browsers

working_directory: ~/repo

Expand Down Expand Up @@ -34,9 +34,7 @@ jobs:
name: coverage
environment:
COVERALLS_REPO_TOKEN: "9tBxvG8hoJroIbSNdMMNY9kNKTFVgVhQd"
command: |
npm run cov
npm run cov-html
command: npm run coveralls

- store_test_results:
path: reports
Expand Down
20 changes: 10 additions & 10 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
"node": true,
"mocha": true
},
"globals": {
"Vue": true,
"globals": true
},
"rules": {
"camelcase": [
"error",
Expand All @@ -19,11 +15,15 @@
}
]
},
"overrides": [{
"files": ["*.spec.js"],
"rules": {
"no-unused-expressions": "off",
"max-nested-callbacks": "off"
"overrides": [
{
"files": [
"*.spec.js"
],
"rules": {
"no-unused-expressions": "off",
"max-nested-callbacks": "off"
}
}
}]
]
}
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@ jspm_packages
.node_repl_history

# generated files
/dist/index.js
/dist/index.esm.js
.reify-cache/
index.js

# nyc test coverage
.nyc_output
reports

# editor files
Expand Down
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Purpose
```bash
npm install -S @dreipol/vue-ui
```

## Mixins
### `intersectionObserverMixin`
[IntersectionObserver API](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver)
Expand All @@ -33,13 +33,13 @@ Now you can start observing an element by
This methods accepts 4 parameters

```js

/**
* @param {Element} element - Dom element
* @param {number} thresholdMin - minimal threshold trigger
* @param {number} thresholdMax - maximal threshold trigger
* @param {Object} config - Config options
*/
*/
registerObserver(element, thresholdMin, thresholdMax = null, config = {})
```

Expand Down Expand Up @@ -74,11 +74,11 @@ export default {
this.setNavVisibility({ isVisible: false });
},
},

beforeDestroy(){
this.unregister(this.$refs.mainNavBar.$el);
},

mounted() {
this.registerObserver(this.$el, 0.1);
},
Expand All @@ -99,9 +99,9 @@ __Usage__

__Props__

| Name | Type | Default |
| --- | --- | ---|
|`thresholdMin` |Number| 0.1 |
| Name | Type | Default |
| --- | --- | ---|
|`thresholdMin` |Number| 0.1 |
|`thresholdMax` |Number| null|

__Events__
Expand All @@ -121,7 +121,7 @@ __Example__

### `scroll-reveal`
Reveals the component passed by the slot while scrolling upwards and hides it when scrolling down.
You have to set the `bemRoot` prop. This prop is bem root class. `scroll-reveal` will add interfaces such as
You have to set the `bemRoot` prop. This prop is bem root class. `scroll-reveal` will add interfaces such as
- `&__pinned`
- `&__unpinned`
- `&__top`
Expand All @@ -138,7 +138,7 @@ Example Usage
<main-header />
</scroll-reveal>
```


Example SCSS

Expand All @@ -149,11 +149,11 @@ Example SCSS
height: 80px;
transition: top 200ms ease-in-out;
}

&.reduced-nav__top {
display: none;
}

&.reduced-nav__not-top {
display: block;
}
Expand Down
Loading