Add clean task, remove build task from test, update dependencies
This commit is contained in:
parent
551860ffcd
commit
dcd1d33c11
11
package.json
11
package.json
@ -53,8 +53,8 @@
|
||||
"autoprefixer": "^6.5.3",
|
||||
"ava": "^0.17.0",
|
||||
"backstopjs": "^2.3.3",
|
||||
"banner-cli": "^0.5.0",
|
||||
"browser-sync": "^2.18.1",
|
||||
"banner-cli": "^0.6.0",
|
||||
"browser-sync": "^2.18.2",
|
||||
"coveralls": "^2.11.15",
|
||||
"node-sass": "^3.13.0",
|
||||
"npm-run-all": "^2.3.0",
|
||||
@ -70,15 +70,16 @@
|
||||
"prestart": "npm install",
|
||||
"pretest": "npm install",
|
||||
"banner": "banner-cli dist/*.css",
|
||||
"clean": "rm -rf dist",
|
||||
"autoprefixer": "postcss -u autoprefixer --no-map.inline --autoprefixer.browsers \"last 1 versions\" -r dist/*.css",
|
||||
"sass": "node-sass --output-style expanded src/milligram.sass dist/milligram.css && node-sass --output-style compressed src/milligram.sass dist/milligram.min.css",
|
||||
"lint": "sass-lint -c .sasslintrc \"src/*.sass\" --verbose --no-exit",
|
||||
"build": "run-s lint sass autoprefixer banner",
|
||||
"build": "run-s clean lint sass autoprefixer banner",
|
||||
"watch": "onchange src -- npm run build",
|
||||
"serve": "browser-sync start --no-notify -s test --ss dist -f dist",
|
||||
"start": "run-p watch serve",
|
||||
"test": "run-s build",
|
||||
"coverage": "nyc ava | coveralls",
|
||||
"test": "nyc ava",
|
||||
"coveralls": "nyc report --reporter=text-lcov | coveralls",
|
||||
"reference": "backstop reference --configPath=backstop.conf.js",
|
||||
"compare": "backstop test --configPath=backstop.conf.js",
|
||||
"backstop": "run-s build && run-p serve compare"
|
||||
|
33
test/unit/build.js
Normal file
33
test/unit/build.js
Normal file
@ -0,0 +1,33 @@
|
||||
const test = require('ava');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
let dist = path.join(__dirname, '../../dist');
|
||||
|
||||
test.before('`dist` path should be created', t => {
|
||||
t.true(fs.lstatSync(dist).isDirectory());
|
||||
});
|
||||
|
||||
test('`milligram.css` should be created', t => {
|
||||
fs.readdirSync(dist).map(file => {
|
||||
if (file === 'milligram.css') t.is(file, 'milligram.css');
|
||||
});
|
||||
});
|
||||
|
||||
test('`milligram.min.css` should be created', t => {
|
||||
fs.readdirSync(dist).map(file => {
|
||||
if (file === 'milligram.min.css') t.is(file, 'milligram.min.css');
|
||||
});
|
||||
});
|
||||
|
||||
test('`milligram.css.map` should be created', t => {
|
||||
fs.readdirSync(dist).map(file => {
|
||||
if (file === 'milligram.css.map') t.is(file, 'milligram.css.map');
|
||||
});
|
||||
});
|
||||
|
||||
test('`milligram.min.css.map` should be created', t => {
|
||||
fs.readdirSync(dist).map(file => {
|
||||
if (file === 'milligram.min.css.map') t.is(file, 'milligram.min.css.map');
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user