1 | var chai = require('chai'); |
||
2 | var path = require('path'); |
||
3 | |||
4 | var coreUtils = require('../src/cli').coreUtils |
||
5 | var fse = require('fs-extra') |
||
6 | var config = require('../src/cli').config |
||
7 | config.set({root: path.join(__dirname,'fixtures')}) |
||
8 | |||
9 | describe('Url', function() { |
||
10 | |||
11 | var urls = fse.readJsonSync(path.join(__dirname, 'fixtures', 'string', 'urls.json'), 'utf8') |
||
12 | |||
13 | /** |
||
14 | * getAbeImport |
||
15 | * |
||
16 | */ |
||
17 | it('configuration file', function() { |
||
18 | for(var key in urls){ |
||
0 ignored issues
–
show
|
|||
19 | chai.assert.equal(coreUtils.slug.clean(key), urls[key] + config.files.templates.extension, key + 'slugified url did not match') |
||
20 | } |
||
21 | }); |
||
22 | |||
23 | }); |
||
24 |
When iterating over the keys of an object, this includes not only the keys of the object, but also keys contained in the prototype of that object. It is generally a best practice to check for these keys specifically: