-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0ff204
commit de0e7da
Showing
4 changed files
with
22 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
package-lock.json | ||
.nyc_output/ |
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
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,26 +1,28 @@ | ||
/* globals require __dirname */ | ||
|
||
const fs = require('fs'); | ||
const test = require('tap').test; | ||
|
||
const renderedPath = __dirname + '/../renders/sheilded/'; | ||
const renderedPath = __dirname + '/../renders/shielded/'; | ||
const inputPath = __dirname + '/../src/shielded/'; | ||
const sizes = [14, 22, 30]; | ||
|
||
test('NPMap Symbol Library', function (t) { | ||
let jsonStandalone; | ||
let jsonShielded; | ||
|
||
t.doesNotThrow(function () { | ||
jsonStandalone = JSON.parse(fs.readFileSync(renderedPath + '/[email protected]')); | ||
}, 'Standalone JSON is invalid'); | ||
jsonStandalone.forEach(function (f) { | ||
t.equal(typeof f.name, 'string', 'name property'); | ||
t.equal(typeof f.icon, 'string', 'icon property'); | ||
t.equal(typeof f.release, 'string', 'release property'); | ||
t.equal(typeof f.tags, 'object', 'tags property'); | ||
sizes.forEach(function (size) { | ||
t.doesNotThrow(function () { | ||
fs.statSync(inputPath + f.icon + '-' + size + '.svg'); | ||
}, 'source file present'); | ||
}); | ||
jsonShielded = JSON.parse(fs.readFileSync(renderedPath + '[email protected]')); | ||
}, 'Shielded JSON file is invalid'); | ||
Object.keys(jsonShielded).forEach(function (key) { | ||
let f = jsonShielded[key]; | ||
t.equal(typeof key, 'string', 'name property'); | ||
t.equal(typeof f.width, 'number', 'width property'); | ||
t.equal(typeof f.height, 'number', 'height property'); | ||
t.equal(typeof f.x, 'number', 'x property'); | ||
t.equal(typeof f.y, 'number', 'y property'); | ||
t.equal(typeof f.pixelRatio, 'number', 'pixelRatioproperty'); | ||
t.doesNotThrow(function () { | ||
fs.statSync(inputPath + key + '.svg'); | ||
}, 'source file present'); | ||
}); | ||
t.end(); | ||
}); |