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/blocks.js

51 lines
1.3 KiB

const { assert } = require('chai')
const fs = require('fs')
const configStore = require('./../src/config.js')
describe('Blocks / Array', function () {
configStore.set('source', './ressources')
configStore.set('destination', './dist')
// get function parseMarkdownFile
const BlocksQuery = require('./../src/queries/blocks.js')
const blocksQuery = new BlocksQuery('./ressources', 'index.md')
const results = blocksQuery.find()
// check results
it('block is array', function() {
assert.isArray(results.block)
})
it('block has length of 2', function() {
assert.equal(results.block.length, 2)
})
it('title in first block are equal', function() {
assert.equal(results.block[0].title, 'health goth DIY tattooed')
})
})
describe('Blocks / Single', function () {
configStore.set('source', './ressources')
configStore.set('destination', './dist')
// get function parseMarkdownFile
const BlocksQuery = require('./../src/queries/blocks.js')
const blocksQuery = new BlocksQuery('./ressources', 'index.md')
const results = blocksQuery.find()
// check results
it('block is array', function() {
assert.isObject(results.data)
})
it('block has length of 2', function() {
assert.equal(results.data.title, 'Data')
})
})