const assert = require('assert') const fs = require('fs') const path = require('path') const stageToFountain = require('../dist/stage-fountain').stageToFountain const testFiles = fs.readdirSync(path.resolve(__dirname, './data/')) for (let file of testFiles) { it(`should parse ${file} correctly`, () => { const entryPath = path.resolve(__dirname, 'data', file) const expectedPath = path.resolve(__dirname, 'expected', path.basename(file, '.stage') + '.fountain') const str = fs.readFileSync(entryPath, 'utf-8') const expected = fs.readFileSync(expectedPath, 'utf-8') const result = stageToFountain(str) assert.strictEqual(result.trim(), expected.trim()) }) }