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

43 lines
1.1 KiB

const { assert } = require('chai')
const fs = require('fs')
describe('Blocks / Array', function () {
// 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 () {
// 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')
})
})