23 lines
655 B
JavaScript
23 lines
655 B
JavaScript
import { describe, it } from "vitest"
|
|
import { document } from '../../../implementations/js/packages/core/src/terrace.js'
|
|
import fs from 'node:fs'
|
|
import readline from 'node:readline/promises'
|
|
|
|
describe('Terrace DSL: thederf.com', () => {
|
|
it('loads', async () => {
|
|
const it = readline.createInterface({
|
|
input: fs.createReadStream('./test.tce', 'utf-8'),
|
|
})[Symbol.asyncIterator]()
|
|
|
|
const getLine = async () => {
|
|
console.log(1)
|
|
console.log('GETLINE', await it.next())
|
|
console.log(2)
|
|
const val = (await it.next()).value
|
|
return val
|
|
}
|
|
|
|
const doc = document(getLine, ' ')
|
|
doc.next(() => {})
|
|
})
|
|
}) |