2020-06-26 21:00:10 +02:00
|
|
|
const fs = require('fs-extra')
|
|
|
|
|
const path = require('path')
|
|
|
|
|
const yaml = require('js-yaml')
|
|
|
|
|
const points_lib = require('../src/points')
|
|
|
|
|
|
|
|
|
|
const fixtures = path.join(__dirname, 'fixtures')
|
|
|
|
|
const absolem_config = yaml.load(fs.readFileSync(path.join(fixtures, 'absolem.yaml')).toString())
|
|
|
|
|
|
|
|
|
|
describe('Absolem', function() {
|
|
|
|
|
it('#points', function() {
|
|
|
|
|
const expected = fs.readJSONSync(path.join(fixtures, 'absolem_points.json'))
|
|
|
|
|
const actual = points_lib.parse(absolem_config.points)
|
|
|
|
|
// remove metadata, so that it only checks the points
|
|
|
|
|
Object.values(actual).map(val => delete val.meta)
|
2020-07-21 19:45:01 +02:00
|
|
|
// only check points in the "main" zones
|
|
|
|
|
for (const key of Object.keys(actual)) {
|
|
|
|
|
if (!expected[key]) {
|
|
|
|
|
delete actual[key]
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-06-26 21:00:10 +02:00
|
|
|
actual.should.deep.equal(expected)
|
|
|
|
|
})
|
|
|
|
|
})
|