Added tape tests
This commit is contained in:
parent
0928222c4e
commit
1ee0a2ac6c
|
@ -3,9 +3,6 @@
|
|||
"version": "0.2.3",
|
||||
"description": "Gulp plugin for sass",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/dlmanning/gulp-sass"
|
||||
|
@ -23,9 +20,10 @@
|
|||
"clone": "~0.1.10",
|
||||
"node-sass": "~0.7.0",
|
||||
"gulp-util": "~2.2.5"
|
||||
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp": "~3.2.3"
|
||||
"gulp": "~3.2.3",
|
||||
"tape": "~2.3.2",
|
||||
"concat-stream": "~1.4.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
.error, .badError {
|
||||
border: 1px red;
|
||||
background: #ffdddd; }
|
||||
|
||||
.error.intrusion {
|
||||
font-size: 1.3em;
|
||||
font-weight: bold; }
|
||||
|
||||
.badError {
|
||||
border-width: 3px; }
|
|
@ -1,8 +0,0 @@
|
|||
#data {
|
||||
float: left;
|
||||
margin-left: 10px; }
|
||||
#data th {
|
||||
text-align: center;
|
||||
font-weight: bold; }
|
||||
#data td, #data th {
|
||||
padding: 2px; }
|
|
@ -1,9 +0,0 @@
|
|||
table.hl {
|
||||
margin: 2em 0; }
|
||||
table.hl td.ln {
|
||||
text-align: right; }
|
||||
|
||||
li {
|
||||
font-family: serif;
|
||||
font-weight: bold;
|
||||
font-size: 1.2em; }
|
|
@ -1,8 +0,0 @@
|
|||
.content-navigation {
|
||||
border-color: #3bbfce;
|
||||
color: #2ca2af; }
|
||||
|
||||
.border {
|
||||
padding: 8px;
|
||||
margin: 8px;
|
||||
border-color: #3bbfce; }
|
26
test/test.js
26
test/test.js
|
@ -1,7 +1,27 @@
|
|||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
|
||||
var test = require('tape');
|
||||
|
||||
var gulp = require('gulp')
|
||||
, sass = require('../')
|
||||
, util = require('gulp-util')
|
||||
, gulpSass = require('../')
|
||||
, nodeSass = require('node-sass');
|
||||
;
|
||||
|
||||
gulp.src('./scss/*.scss')
|
||||
.pipe(sass())
|
||||
.pipe(gulp.dest('./css/'));
|
||||
.pipe(gulpSass())
|
||||
.pipe(util.buffer(tapeTester));
|
||||
|
||||
function tapeTester(err, files) {
|
||||
files.forEach(function (item) {
|
||||
var fileBaseName = path.basename(item.path, '.css');
|
||||
test('Testing: ' + fileBaseName, function (t) {
|
||||
var ref = nodeSass.renderSync({
|
||||
data: fs.readFileSync('./scss/' + fileBaseName + '.scss').toString()
|
||||
})
|
||||
t.equal(item.contents.toString(), ref);
|
||||
t.end();
|
||||
})
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue