From af1d3fc26a289f6ddf56cf6c8bdc90e50f58760a Mon Sep 17 00:00:00 2001 From: CJ Patoilo Date: Tue, 22 Nov 2016 19:27:09 -0300 Subject: [PATCH 1/5] Added unit test and coveralls --- .coveralls.yml | 1 + .npmignore | 2 + bower.json | 1 + component.json | 1 + composer.json | 1 + package.json | 7 ++ test/unit/package-spec.js | 137 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 150 insertions(+) create mode 100644 .coveralls.yml create mode 100644 test/unit/package-spec.js diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..c16bacd --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1 @@ +repo_token: m1BEx78tPMAxcADSCK5vtqLfzdj5oU82P diff --git a/.npmignore b/.npmignore index daf8a45..c6b61a5 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,5 @@ + +.coveralls.yml .editorconfig .github .gitignore diff --git a/bower.json b/bower.json index 0759f0e..eca63a3 100644 --- a/bower.json +++ b/bower.json @@ -28,6 +28,7 @@ "stylus" ], "ignore": [ + ".coveralls.yml", ".editorconfig", ".github", ".gitignore", diff --git a/component.json b/component.json index f99a4d2..287d91a 100644 --- a/component.json +++ b/component.json @@ -28,6 +28,7 @@ "stylus" ], "ignore": [ + ".coveralls.yml", ".editorconfig", ".github", ".gitignore", diff --git a/composer.json b/composer.json index b07c04f..0c7a10a 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,7 @@ "stylus" ], "ignore": [ + ".coveralls.yml", ".editorconfig", ".github", ".gitignore", diff --git a/package.json b/package.json index 315f7fd..c48d2d6 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "stylus" ], "ignore": [ + ".coveralls.yml", ".editorconfig", ".github", ".gitignore", @@ -51,10 +52,15 @@ "autoprefixer": "^6.5.3", "backstopjs": "^2.3.3", "browser-sync": "^2.18.1", + "coveralls": "^2.11.15", + "intelli-espower-loader": "^1.0.1", + "istanbul": "^0.4.5", + "mocha": "^3.1.2", "node-sass": "^3.13.0", "npm-run-all": "^2.3.0", "onchange": "^2.5.0", "postcss-cli": "^2.6.0", + "power-assert": "^1.4.2", "sass-lint": "^1.10.2" }, "engines": { @@ -72,6 +78,7 @@ "serve": "browser-sync start --no-notify -s test --ss dist -f dist", "start": "run-p watch serve", "test": "run-s build", + "coverage": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --require intelli-espower-loader test/unit/*.js", "reference": "backstop reference --configPath=backstop.conf.js", "compare": "backstop test --configPath=backstop.conf.js", "backstop": "run-s build && run-p serve compare" diff --git a/test/unit/package-spec.js b/test/unit/package-spec.js new file mode 100644 index 0000000..b98467d --- /dev/null +++ b/test/unit/package-spec.js @@ -0,0 +1,137 @@ +const fs = require('fs'); +const assert = require('power-assert'); +const npm = require('../../package.json'); +const bower = require('../../bower.json'); +const component = require('../../component.json'); +const composer = require('../../composer.json'); + +const packages = [ + npm, + bower, + component, + composer +]; + +describe('Package', () => { + + describe('Name', () => { + + it(`should be equal to ${npm.name}`, () => { + packages.map((referenceValue, referenceIndex) => { + packages.map((compareValue, compareIndex) => { + if (referenceIndex !== compareIndex) assert(referenceValue.name, compareValue.name); + }); + }); + }); + + }); + + describe('Version', () => { + + it(`should be equal to v${npm.version}`, () => { + packages.map((referenceValue, referenceIndex) => { + packages.map((compareValue, compareIndex) => { + if (referenceIndex !== compareIndex) assert(referenceValue.version, compareValue.version); + }); + }); + }); + + }); + + describe('Description', () => { + + it(`should be equal to ${npm.description}`, () => { + packages.map((referenceValue, referenceIndex) => { + packages.map((compareValue, compareIndex) => { + if (referenceIndex !== compareIndex) assert(referenceValue.description, compareValue.description); + }); + }); + }); + + }); + + describe('Homepage', () => { + + it(`should be equal to ${npm.homepage}`, () => { + packages.map((referenceValue, referenceIndex) => { + packages.map((compareValue, compareIndex) => { + if (referenceIndex !== compareIndex) assert(referenceValue.homepage, compareValue.homepage); + }); + }); + }); + + }); + + describe('Repository', () => { + + it(`should be equal to ${npm.repository}`, () => { + packages.map((referenceValue, referenceIndex) => { + packages.map((compareValue, compareIndex) => { + if (referenceIndex !== compareIndex) assert(referenceValue.repository, compareValue.repository); + }); + }); + }); + + }); + + describe('License', () => { + + it(`should be equal to ${npm.license}`, () => { + packages.map((referenceValue, referenceIndex) => { + packages.map((compareValue, compareIndex) => { + if (referenceIndex !== compareIndex) assert(referenceValue.license, compareValue.license); + }); + }); + }); + + }); + + describe('Author Name', () => { + + it(`should be equal to ${npm.author}`, () => { + packages.map((referenceValue, referenceIndex) => { + packages.map((compareValue, compareIndex) => { + if (referenceIndex !== compareIndex) assert(referenceValue.author, compareValue.author); + }); + }); + }); + + }); + + describe('Main File', () => { + + it(`should be equal to ${npm.main}`, () => { + packages.map((referenceValue, referenceIndex) => { + packages.map((compareValue, compareIndex) => { + if (referenceIndex !== compareIndex) assert(referenceValue.main, compareValue.main); + }); + }); + }); + + }); + + describe('Ignore', () => { + + it(`should be equal`, () => { + packages.map((referenceValue, referenceIndex) => { + packages.map((compareValue, compareIndex) => { + if (referenceIndex !== compareIndex) assert(referenceValue.ignore, compareValue.ignore); + }); + }); + }); + + }); + + describe('Keywords', () => { + + it(`should be equal`, () => { + packages.map((referenceValue, referenceIndex) => { + packages.map((compareValue, compareIndex) => { + if (referenceIndex !== compareIndex) assert(referenceValue.keywords, compareValue.keywords); + }); + }); + }); + + }); + +}); From 298eab1fa2160188371bc85adc9df36fb2d38ffc Mon Sep 17 00:00:00 2001 From: CJ Patoilo Date: Tue, 22 Nov 2016 19:28:46 -0300 Subject: [PATCH 2/5] Added appveyor --- .appveyor.yml | 10 ++++++++++ .npmignore | 1 + bower.json | 1 + component.json | 1 + composer.json | 1 + package.json | 1 + 6 files changed, 15 insertions(+) create mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..9b5df21 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,10 @@ +environment: + nodejs_version: 7 +platform: + - x86 + - x64 +install: + - ps: Install-Product node $env:nodejs_version $env:platform + - npm install +test_script: npm test +build: off diff --git a/.npmignore b/.npmignore index c6b61a5..5de72a9 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,5 @@ +.appveyor.yml .coveralls.yml .editorconfig .github diff --git a/bower.json b/bower.json index eca63a3..415617e 100644 --- a/bower.json +++ b/bower.json @@ -28,6 +28,7 @@ "stylus" ], "ignore": [ + ".appveyor.yml", ".coveralls.yml", ".editorconfig", ".github", diff --git a/component.json b/component.json index 287d91a..6bd639e 100644 --- a/component.json +++ b/component.json @@ -28,6 +28,7 @@ "stylus" ], "ignore": [ + ".appveyor.yml", ".coveralls.yml", ".editorconfig", ".github", diff --git a/composer.json b/composer.json index 0c7a10a..5f716d2 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,7 @@ "stylus" ], "ignore": [ + ".appveyor.yml", ".coveralls.yml", ".editorconfig", ".github", diff --git a/package.json b/package.json index c48d2d6..e86edac 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "stylus" ], "ignore": [ + ".appveyor.yml", ".coveralls.yml", ".editorconfig", ".github", From 013511b58e08270120f4e0545fee33dd34158587 Mon Sep 17 00:00:00 2001 From: CJ Patoilo Date: Tue, 22 Nov 2016 19:29:33 -0300 Subject: [PATCH 3/5] Update badges on readme file --- readme.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index ea699bf..c34c607 100644 --- a/readme.md +++ b/readme.md @@ -2,11 +2,13 @@ > A minimalist CSS framework. -[![Build Status](https://travis-ci.org/milligram/milligram.svg?branch=master)](https://travis-ci.org/milligram/milligram) -[![Dependencies Status](https://david-dm.org/milligram/milligram.svg)](https://travis-ci.org/milligram/milligram) -[![npm version](https://badge.fury.io/js/milligram.svg)](https://badge.fury.io/js/milligram) -[![Bower version](https://badge.fury.io/bo/milligram.svg)](https://badge.fury.io/bo/milligram) -[![Gitter chat](https://img.shields.io/badge/gitter-join_the_chat-4cc61e.svg)](https://gitter.im/milligram/milligram) +[![Travis Status](https://travis-ci.org/milligram/milligram.svg?branch=master)](https://travis-ci.org/milligram/milligram?branch=master) +[![AppVeyor Status](https://ci.appveyor.com/api/projects/status/wabkk000uh6d97xk?svg=true)](https://ci.appveyor.com/project/cjpatoilo/milligram) +[![Version Status](https://badge.fury.io/js/milligram.svg)](https://www.npmjs.com/package/milligram) +[![Dependencies Status](https://david-dm.org/milligram/milligram.svg)](https://travis-ci.org/milligram/milligram?branch=master) +[![Codacy Status](https://img.shields.io/codacy/grade/848fb4bd6902434fab0bcfb5461284fe/master.svg)](https://www.codacy.com/app/cjpatoilo/milligram/dashboard) +[![Download Status](https://img.shields.io/npm/dt/milligram.svg)](https://www.npmjs.com/package/milligram) +[![Gitter Chat](https://img.shields.io/badge/gitter-join_the_chat-4cc61e.svg)](https://gitter.im/milligram/milligram) ## Why it's awesome? From 7ed897cd1dc7a1a5d7752f73b68dfd829d347e1b Mon Sep 17 00:00:00 2001 From: CJ Patoilo Date: Tue, 22 Nov 2016 19:30:05 -0300 Subject: [PATCH 4/5] Added eslint --- .eslintrc | 13 +++++++++++++ .npmignore | 1 + bower.json | 1 + component.json | 1 + composer.json | 1 + package.json | 1 + 6 files changed, 18 insertions(+) create mode 100644 .eslintrc diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..c687d09 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,13 @@ +{ + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module", + "ecmaFeatures": { + "jsx": true + } + }, + "rules": { + "semi": 2, + "quotes": ["error", "single"] + } +} diff --git a/.npmignore b/.npmignore index 5de72a9..55c11f1 100644 --- a/.npmignore +++ b/.npmignore @@ -2,6 +2,7 @@ .appveyor.yml .coveralls.yml .editorconfig +.eslintrc .github .gitignore .npmignore diff --git a/bower.json b/bower.json index 415617e..dd83ec8 100644 --- a/bower.json +++ b/bower.json @@ -31,6 +31,7 @@ ".appveyor.yml", ".coveralls.yml", ".editorconfig", + ".eslintrc", ".github", ".gitignore", ".npmignore", diff --git a/component.json b/component.json index 6bd639e..6616f91 100644 --- a/component.json +++ b/component.json @@ -31,6 +31,7 @@ ".appveyor.yml", ".coveralls.yml", ".editorconfig", + ".eslintrc", ".github", ".gitignore", ".npmignore", diff --git a/composer.json b/composer.json index 5f716d2..e73dff1 100644 --- a/composer.json +++ b/composer.json @@ -31,6 +31,7 @@ ".appveyor.yml", ".coveralls.yml", ".editorconfig", + ".eslintrc", ".github", ".gitignore", ".npmignore", diff --git a/package.json b/package.json index e86edac..89116f8 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ ".appveyor.yml", ".coveralls.yml", ".editorconfig", + ".eslintrc", ".github", ".gitignore", ".npmignore", From f88f8d2fefd8e008d2c9320d0dfdc20a206c1044 Mon Sep 17 00:00:00 2001 From: CJ Patoilo Date: Tue, 22 Nov 2016 19:30:41 -0300 Subject: [PATCH 5/5] Remove selector from browser-sync --- backstop.conf.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/backstop.conf.js b/backstop.conf.js index 1852361..77234ce 100644 --- a/backstop.conf.js +++ b/backstop.conf.js @@ -7,7 +7,7 @@ module.exports = { label: 'Typography', url: 'http://localhost:3000', hideSelectors: [], - removeSelectors: ['#__bs_notify__'], + removeSelectors: [], selectors: ['#typography'], readyEvent: null, delay: 500, @@ -18,7 +18,7 @@ module.exports = { label: 'Blockquotes', url: 'http://localhost:3000', hideSelectors: [], - removeSelectors: ['#__bs_notify__'], + removeSelectors: [], selectors: ['#blockquotes'], readyEvent: null, delay: 500, @@ -29,7 +29,7 @@ module.exports = { label: 'Buttons', url: 'http://localhost:3000', hideSelectors: [], - removeSelectors: ['#__bs_notify__'], + removeSelectors: [], selectors: ['#buttons'], readyEvent: null, delay: 500, @@ -40,7 +40,7 @@ module.exports = { label: 'Lists', url: 'http://localhost:3000', hideSelectors: [], - removeSelectors: ['#__bs_notify__'], + removeSelectors: [], selectors: ['#lists'], readyEvent: null, delay: 500, @@ -51,7 +51,7 @@ module.exports = { label: 'Forms', url: 'http://localhost:3000', hideSelectors: [], - removeSelectors: ['#__bs_notify__'], + removeSelectors: [], selectors: ['#forms'], readyEvent: null, delay: 500, @@ -62,7 +62,7 @@ module.exports = { label: 'Tables', url: 'http://localhost:3000', hideSelectors: [], - removeSelectors: ['#__bs_notify__'], + removeSelectors: [], selectors: ['#tables'], readyEvent: null, delay: 500, @@ -73,7 +73,7 @@ module.exports = { label: 'Grids', url: 'http://localhost:3000', hideSelectors: [], - removeSelectors: ['#__bs_notify__'], + removeSelectors: [], selectors: ['#grids'], readyEvent: null, delay: 500, @@ -84,7 +84,7 @@ module.exports = { label: 'Codes', url: 'http://localhost:3000', hideSelectors: [], - removeSelectors: ['#__bs_notify__'], + removeSelectors: [], selectors: ['#codes'], readyEvent: null, delay: 500, @@ -95,7 +95,7 @@ module.exports = { label: 'Utilities', url: 'http://localhost:3000', hideSelectors: [], - removeSelectors: ['#__bs_notify__'], + removeSelectors: [], selectors: ['#utilities'], readyEvent: null, delay: 500,