Issues (791)

test/meta.js (3 issues)

1
var chai = require('chai');
2
var path = require('path');
3
4
var config = require('../src/cli').config
5
config.set({root: __dirname + '/fixtures/'})
0 ignored issues
show
Consider using the path module for constructing paths since they are otherwise not cross-OS compatible.
Loading history...
6
7
var cmsData = require('../src/cli').cmsData;
8
var Manager = require('../src/cli').Manager;
9
var fse = require('fs-extra');
10
11
describe('Meta', function() {
12
  before( function(done) {
13
    Manager.instance.init()
14
      .then(function () {
15
try{
16
        this.fixture = {
17
          tag: fse.readFileSync(path.join(__dirname, 'fixtures', 'templates', 'article.html'), 'utf8')
18
        }
19
}catch(e){
20
  console.log("err", e)
21
}
22
        done()
23
        
24
      }.bind(this))
25
  });
26
27
  /**
28
   * cmsData.meta.add
29
   * 
30
   */
31
  it('cmsData.metas.add()', function() {
32
    var json = {abe_meta: {link: 'article.html'}};
33
    cmsData.metas.add(json, 'draft');
34
    chai.expect(json.abe_meta.date).to.not.be.undefined;
0 ignored issues
show
The result of the property access to chai.expect(json.abe_met...te).to.not.be.undefined is not used.
Loading history...
35
  });
36
37
  /**
38
   * cmsData.meta.create
39
   * 
40
   */
41
  it('cmsData.metas.create()', function() {
42
    var json = cmsData.metas.create({}, 'draft', 'test.html');
43
    chai.expect(json.abe_meta.link).to.not.be.undefined;
0 ignored issues
show
The result of the property access to chai.expect(json.abe_met...nk).to.not.be.undefined is not used.
Loading history...
44
  });
45
});
46