flecks/packages/core/test/write-files.js
2024-02-14 20:16:31 -06:00

18 lines
460 B
JavaScript

/* eslint-disable camelcase */
import {access} from 'fs/promises';
import {join} from 'path';
import {createWorkspace} from '@flecks/core/build/testing';
import {writeFile} from '@flecks/core/server';
it('writes files', async () => {
const workspace = await createWorkspace();
/* eslint-disable no-await-in-loop */
for (let i = 0; i < 10; ++i) {
const path = join(workspace, `${i}`);
await writeFile(path, '');
await access(path);
}
});