const { assert } = require('chai') const fs = require('fs') const PagesQuery = require('./../src/queries/pages.js') describe('Page /index.md', function () { const query = new PagesQuery('./ressources'); const results = query.find() const page = results[2] it('fields is object', function() { assert.isObject(page) }) it('path', function() { assert.equal(page.path, '/index.html') }) it('permalink', function() { assert.equal(page.permalink, '') }) }) describe('Page /blog/article.md', function () { const query = new PagesQuery('./ressources'); const results = query.find() const page = results[0] it('fields is object', function() { assert.isObject(page) }) it('path', function() { assert.equal(page.path, '/blog/article.html') }) it('permalink', function() { assert.equal(page.permalink, '/blog/article') }) })