simple-carousel
Advanced tools
| 'use strict'; | ||
| var _names = require('./names.json'); | ||
| var _names2 = _interopRequireDefault(_names); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| module.exports = { | ||
| all: _names2.default, | ||
| mirror: mirror | ||
| }; | ||
| function mirror(value) { | ||
| if (value === undefined) { | ||
| return false; | ||
| } else { | ||
| return value; | ||
| } | ||
| }; |
| [ | ||
| "Hello", | ||
| "World" | ||
| ] |
+35
-5
| { | ||
| "name": "simple-carousel", | ||
| "version": "1.0.0", | ||
| "version": "1.1.0", | ||
| "description": "Simple carousel library", | ||
@@ -8,4 +8,9 @@ "main": "src/index.js", | ||
| "commit": "git-cz", | ||
| "test": "mocha src/index.test.js -w", | ||
| "test:single": "mocha src/index.test.js", | ||
| "check-coverage": "nyc check-coverage --statements 100 --branches 100 --functions 100 --lines 100", | ||
| "report-coverage": "cat ./coverage/lcov.info | codecov", | ||
| "watch:test": "npm t -- -w", | ||
| "test": "mocha src/index.test.js --compilers js:babel-register", | ||
| "cover": "nyc npm t", | ||
| "prebuild": "rimraf dist", | ||
| "build": "babel --copy-files --out-dir dist --ignore *.test.js src", | ||
| "semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
@@ -21,2 +26,6 @@ }, | ||
| ], | ||
| "files": [ | ||
| "dist", | ||
| "README.md" | ||
| ], | ||
| "author": "Ernest Sim <ernest.codes@gmail.com> (https://github.com/idl3)", | ||
@@ -29,11 +38,32 @@ "license": "MIT", | ||
| "devDependencies": { | ||
| "babel-cli": "6.14.0", | ||
| "babel-preset-es2015": "6.14.0", | ||
| "babel-preset-es2017": "6.14.0", | ||
| "babel-preset-stage-3": "6.11.0", | ||
| "babel-register": "6.14.0", | ||
| "chai": "3.5.0", | ||
| "codecov.io": "0.1.6", | ||
| "commitizen": "2.8.6", | ||
| "cz-conventional-changelog": "1.2.0", | ||
| "ghooks": "1.3.2", | ||
| "istanbul": "0.4.5", | ||
| "mocha": "3.0.2", | ||
| "nyc": "8.3.0", | ||
| "rimraf": "2.5.4", | ||
| "semantic-release": "^4.3.5" | ||
| }, | ||
| "czConfig": { | ||
| "path": "node_modules/cz-conventional-changelog" | ||
| "config": { | ||
| "ghooks": { | ||
| "pre-commit": "npm run cover && npm run check-coverage" | ||
| }, | ||
| "commitizen": { | ||
| "path": "node_modules/cz-conventional-changelog" | ||
| }, | ||
| "babel": { | ||
| "presets": [ | ||
| "es2015", | ||
| "es2017" | ||
| ] | ||
| } | ||
| } | ||
| } |
+8
-1
@@ -1,1 +0,8 @@ | ||
| # Carousel | ||
| # Simple Carousel | ||
| [](https://travis-ci.org/grain-tech/Carousel) | ||
| [](https://codecov.io/gh/grain-tech/Carousel) | ||
| [](https://www.npmjs.com/package/simple-carousel) | ||
| [](https://opensource.org/licenses/MIT) | ||
| Simple and lightweight carousel script |
-20
| sudo: false | ||
| language: node_js | ||
| cache: | ||
| directories: | ||
| - node_modules | ||
| notifications: | ||
| email: false | ||
| node_js: | ||
| - '4' | ||
| before_install: | ||
| - npm i -g npm@^2.0.0 | ||
| before_script: | ||
| - npm prune | ||
| script: | ||
| - npm run test:single | ||
| after_success: | ||
| - npm run semantic-release | ||
| branches: | ||
| except: | ||
| - /^v\d+\.\d+\.\d+$/ |
-13
| var names = require('./names.json'); | ||
| var mirror = function(value){ | ||
| if (value === undefined) { | ||
| return false; | ||
| } else { | ||
| return value; | ||
| } | ||
| }; | ||
| module.exports = { | ||
| all: names, | ||
| mirror: mirror | ||
| }; |
| var expect = require('chai').expect; | ||
| var carousel = require('./index'); | ||
| describe('carousel', function() { | ||
| it('should be an array of strings', function() { | ||
| expect(carousel.all).to.satisfy(isArrayOfStrings); | ||
| function isArrayOfStrings(array) { | ||
| return array.every(function(item) { | ||
| return typeof item == 'string'; | ||
| }) | ||
| } | ||
| }); | ||
| it('should contain Hello', function() { | ||
| expect(carousel.all).to.include('Hello'); | ||
| }); | ||
| }); | ||
| describe('mirror', function() { | ||
| it('should return true', function() { | ||
| result = carousel.mirror(); | ||
| expect(result).to.eq(false); | ||
| }); | ||
| it('should return false if passed false', function() { | ||
| result = carousel.mirror('false'); | ||
| expect(result).to.eq('false'); | ||
| }) | ||
| }); |
| [ | ||
| "Hello", | ||
| "World" | ||
| ] |
2797
23.71%9
350%15
200%4
-33.33%18
-56.1%