You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
core/test/pages.js

45 lines
898 B

2 years ago
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')
})
})