const { assert } = require('chai') const fs = require('fs') describe('Filter', function () { // get function const Filter = require('./../src/filter.js') // check results it('_eq', function() { const filter = new Filter({ view: { _eq: 'post.njk' } }) const data = { view: 'post.njk' } assert.equal(filter.validate(data), true) }) it('_neq', function() { const filter = new Filter({ view: { _neq: 'post.njk' } }) const data = { view: 'blog.njk' } assert.equal(filter.validate(data), true) }) it('_in single', function() { const filter = new Filter({ tags: { _in: 'monday' } }) const data = { tags: [ 'monday', 'friday' ] } assert.equal(filter.validate(data), true) }) it('_in array', function() { const filter = new Filter({ tags: { _in: [ 'monday' ] } }) const data = { tags: [ 'monday', 'friday' ] } assert.equal(filter.validate(data), true) }) })