recital / core / test / fragment.spec.js
fragment.spec.js
Raw
const assert = require('assert')
const fs = require('fs')
const path = require('path')

const parseFlat = require('../dist/stage-parser').parseFlat

it('should parse fragments correctly', () => {
	const entryPath = path.resolve(__dirname, './data/fragments/basic.stage')
	const expectedPath = path.resolve(__dirname, './expected/fragments/basic-flats.json')
	const str = fs.readFileSync(entryPath, 'utf-8')
	const json = JSON.parse(fs.readFileSync(expectedPath, 'utf-8'))

	const flats = parseFlat(str)

	assert.deepStrictEqual(flats, json)
})