-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
81 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module.exports = { | ||
logger : { | ||
warn: function(){}, | ||
log: function(){}, | ||
error: function(){} | ||
logger: { | ||
warn: function () {}, | ||
log: function () {}, | ||
error: function () {}, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,48 @@ | ||
'use strict'; | ||
|
||
var assert = require('assert'); | ||
var fs = require('fs'); | ||
var assert = require('assert'); | ||
var rimraf = require('rimraf'); | ||
var sassdoc = require('../../'); | ||
|
||
function clean(done) { | ||
rimraf('sassdoc', done); | ||
} | ||
|
||
function read(filePath) { | ||
return fs.readFileSync(filePath, 'utf8'); | ||
} | ||
|
||
describe('#documentize', function () { | ||
before(clean); | ||
after(clean); | ||
|
||
before(function () { | ||
beforeEach(function () { | ||
return sassdoc('./test/data'); | ||
}); | ||
|
||
after(function (done) { | ||
rimraf('sassdoc', done); | ||
}); | ||
|
||
it('should produce documentation files', function () { | ||
assert.ok(fs.existsSync('sassdoc')); | ||
assert.ok(fs.existsSync('sassdoc/index.html')); | ||
assert.ok(fs.existsSync('sassdoc/assets')); | ||
}); | ||
|
||
}); | ||
|
||
describe('#documentize-parse', function () { | ||
var expected = read('test/data/expected.json').trim(); | ||
var result; | ||
|
||
before(function () { | ||
return sassdoc.parse('test/data/test.scss') | ||
.then(function (data) { | ||
result = data; | ||
}); | ||
}); | ||
|
||
it('should return a proper data Array', function () { | ||
assert.ok(Array.isArray(result)); | ||
assert.strictEqual(expected, JSON.stringify(result, null, 2)); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters