const assert = require('assert') const fs = require('fs') const path = require('path') const stageToInk = require('../dist/stage-ink').stageToInk 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') + '.ink') const str = fs.readFileSync(entryPath, 'utf-8') const expected = fs.readFileSync(expectedPath, 'utf-8') const result = stageToInk(str) assert.strictEqual(result.trim(), expected.trim()) }) }