Skip to content

Commit ac60de1

Browse files
authored
Merge pull request #7 from Mindsers/develop
Be ready for github
2 parents 437ed38 + fd61191 commit ac60de1

File tree

6 files changed

+85
-34
lines changed

6 files changed

+85
-34
lines changed

.gitlab-ci.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: node_js
2+
node_js:
3+
- "6"
4+
5+
install:
6+
- npm install
7+
8+
script:
9+
- npm run test:lint
10+
- npm test

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# How to contribute
2+
3+
We love contributions from everyone if they take care of this contribution guide.
4+
5+
## Issue
6+
7+
Before submiting an issue, please be sure there not exist.
8+
9+
## Code change
10+
11+
To contribute in code base:
12+
13+
1. fork the project
14+
2. make your changes in a new branch
15+
3. write test for your changes
16+
4. submit a pull request
17+
18+
Pull request will only be merged if modified code respect eslint configuration (standardjs with some changes)
19+
and test coverage doesn't fall.

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
[![build status][badge_build_status_image]][badge_build_status_link]
44
[![standardjs style][badge_js_code_style_image]][badge_js_code_style_link]
5-
[![coverage report][badge_coverage_report_image]][badge_coverage_report_link]
5+
[![coverage status][badge_coverage_report_image]][badge_coverage_report_link]
6+
[![MIT license][badge_license_image]][badge_license_link]
67

78
Nativetable is a simple native es6 module to create and work with dynamics HTML tables.
89

@@ -68,6 +69,10 @@ let ntable = new Nativetable('tableid', {
6869
});
6970
```
7071

72+
## Contribution
73+
74+
To contribute to this repo please follow the [contribution guide](https://github.com/Mindsers/nativetable/blob/master/CONTRIBUTING.md).
75+
7176
## License
7277

7378
This project is under the MIT License. (see LICENSE file in the root directory)
@@ -97,9 +102,11 @@ This project is under the MIT License. (see LICENSE file in the root directory)
97102
[wiki]: https://git.nathanaelcherrier.com/mindsers/nativetable/wikis/home
98103
[project]: https://git.nathanaelcherrier.com/mindsers/nativetable
99104

100-
[badge_build_status_image]: https://git.nathanaelcherrier.com/mindsers/nativetable/badges/master/build.svg
101-
[badge_build_status_link]: https://git.nathanaelcherrier.com/mindsers/nativetable/commits/master
105+
[badge_build_status_image]: https://img.shields.io/travis/Mindsers/nativetable/master.svg
106+
[badge_build_status_link]: https://travis-ci.org/Mindsers/nativetable
102107
[badge_js_code_style_image]: https://img.shields.io/badge/code%20style-standard-yellow.svg
103108
[badge_js_code_style_link]: http://standardjs.com
104-
[badge_coverage_report_image]: https://git.nathanaelcherrier.com/mindsers/nativetable/badges/master/coverage.svg
105-
[badge_coverage_report_link]: https://git.nathanaelcherrier.com/mindsers/nativetable/commits/master
109+
[badge_license_image]: https://img.shields.io/badge/license-MIT-blue.svg
110+
[badge_license_link]: https://github.com/Mindsers/nativetable/blob/master/LICENSE
111+
[badge_coverage_report_image]: https://img.shields.io/coveralls/Mindsers/nativetable/master.svg
112+
[badge_coverage_report_link]: https://coveralls.io/github/Mindsers/nativetable

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
"build:dev": "NODE_ENV=development npm run build:clean && npm run build:js -- --sourcemap -w",
1111
"build:prod": "NODE_ENV=production npm run build:clean && npm run build:js",
1212
"build": "npm run build:prod",
13+
"test:coveralls": "npm run test:coverage && nyc report --reporter=text-lcov | coveralls",
1314
"test:coverage": "NODE_ENV=test nyc mocha",
1415
"test:unit": "mocha -r babel-core/register",
16+
"test:lint": "eslint ./src",
1517
"test:clean": "rm -rf coverage",
16-
"test": "npm run test:clean && npm run test:coverage"
18+
"test": "npm run test:clean && npm run test:coveralls"
1719
},
1820
"keywords": [
1921
"table",
@@ -27,11 +29,13 @@
2729
"babel-register": "^6.16.3",
2830
"chai": "^3.5.0",
2931
"chai-spies": "^0.7.1",
32+
"coveralls": "^2.11.15",
3033
"eslint": "^3.7.1",
3134
"eslint-config-standard": "^6.2.0",
3235
"eslint-plugin-promise": "^3.0.0",
3336
"eslint-plugin-standard": "^2.0.1",
3437
"mocha": "^3.1.2",
38+
"mocha-lcov-reporter": "^1.2.0",
3539
"nyc": "^8.3.2",
3640
"rollup": "^0.36.3",
3741
"rollup-plugin-babel": "^2.6.1",

test/nativetable.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ describe('Nativetable', () => {
135135
}
136136
}
137137
}
138+
139+
nt.filtered
138140
}
139141

140142
test.should.not.throw()
@@ -294,6 +296,43 @@ describe('Nativetable', () => {
294296
nt.sorted.should.be.deep.equal(nt.filtered)
295297
})
296298

299+
it('should return last sorting when options.reloading.sorted is false', () => {
300+
let expected = [
301+
{ id: 12, name: 'bjob', lastname: 'rob', age: 81, man: true },
302+
{ id: 12, name: 'boab', lastname: 'rob', age: 81, man: true },
303+
{ id: 12, name: 'bob', lastname: 'ronb', age: 81, man: true },
304+
{ id: 12, name: 'bobg', lastname: 'rob', age: 81, man: true },
305+
{ id: 12, name: 'bodb', lastname: 'rob', age: 81, man: true },
306+
{ id: 12, name: 'bodjb', lastname: 'rfob', age: 81, man: true },
307+
{ id: 12, name: 'bofgb', lastname: 'rob', age: 81, man: true },
308+
{ id: 12, name: 'bokb', lastname: 'rokb', age: 81, man: true },
309+
{ id: 12, name: 'bosb', lastname: 'rob', age: 81, man: true },
310+
{ id: 12, name: 'botb', lastname: 'riob', age: 81, man: true },
311+
{ id: 12, name: 'boub', lastname: 'rbob', age: 81, man: true },
312+
{ id: 12, name: 'bovb', lastname: 'rorb', age: 81, man: true },
313+
{ id: 12, name: 'boxb', lastname: 'rob', age: 81, man: true },
314+
{ id: 12, name: 'bpob', lastname: 'rob', age: 81, man: true }
315+
]
316+
317+
let falseFiltered = [
318+
{ id: 12, name: 'bjob', lastname: 'rob', age: 81, man: true },
319+
{ id: 12, name: 'boab', lastname: 'rob', age: 81, man: true },
320+
{ id: 12, name: 'bob', lastname: 'ronb', age: 81, man: true },
321+
{ id: 12, name: 'bobg', lastname: 'rob', age: 81, man: true },
322+
{ id: 12, name: 'bodb', lastname: 'rob', age: 81, man: true },
323+
{ id: 12, name: 'botb', lastname: 'riob', age: 81, man: true },
324+
{ id: 12, name: 'boub', lastname: 'rbob', age: 81, man: true },
325+
{ id: 12, name: 'bovb', lastname: 'rorb', age: 81, man: true },
326+
{ id: 12, name: 'boxb', lastname: 'rob', age: 81, man: true },
327+
{ id: 12, name: 'bpob', lastname: 'rob', age: 81, man: true }
328+
]
329+
330+
nt.sorted // first call / adding relsult to cache
331+
nt.sources = falseFiltered
332+
nt.options.reloading.sorted = false
333+
nt.sorted.should.be.deep.equal(expected)
334+
})
335+
297336
it('should return ASC sorted sources', () => {
298337
let expected = [
299338
{ id: 12, name: 'bjob', lastname: 'rob', age: 81, man: true },

0 commit comments

Comments
 (0)