flecks/packages/build/test/yml.js
2024-02-14 20:16:31 -06:00

18 lines
511 B
JavaScript

import addPathsToYml from '@flecks/core/build/add-paths-to-yml';
import {loadYml, writeFile} from '@flecks/core/server';
import {expect} from 'chai';
import {readFile} from 'fs/promises';
it('can add paths to YML', async () => {
await writeFile(
'test/yml/build/flecks.yml',
`
bar: {}
foo: {}
`,
);
await addPathsToYml(['a', 'two'], 'test/yml');
expect(Object.keys(await loadYml(await readFile('test/yml/build/flecks.yml'))))
.to.deep.equal(['a', 'bar', 'foo', 'two']);
});