Added unit test and coveralls
This commit is contained in:
parent
f6657df79f
commit
af1d3fc26a
1
.coveralls.yml
Normal file
1
.coveralls.yml
Normal file
@ -0,0 +1 @@
|
||||
repo_token: m1BEx78tPMAxcADSCK5vtqLfzdj5oU82P
|
@ -1,3 +1,5 @@
|
||||
|
||||
.coveralls.yml
|
||||
.editorconfig
|
||||
.github
|
||||
.gitignore
|
||||
|
@ -28,6 +28,7 @@
|
||||
"stylus"
|
||||
],
|
||||
"ignore": [
|
||||
".coveralls.yml",
|
||||
".editorconfig",
|
||||
".github",
|
||||
".gitignore",
|
||||
|
@ -28,6 +28,7 @@
|
||||
"stylus"
|
||||
],
|
||||
"ignore": [
|
||||
".coveralls.yml",
|
||||
".editorconfig",
|
||||
".github",
|
||||
".gitignore",
|
||||
|
@ -28,6 +28,7 @@
|
||||
"stylus"
|
||||
],
|
||||
"ignore": [
|
||||
".coveralls.yml",
|
||||
".editorconfig",
|
||||
".github",
|
||||
".gitignore",
|
||||
|
@ -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"
|
||||
|
137
test/unit/package-spec.js
Normal file
137
test/unit/package-spec.js
Normal file
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user