test: refactor to run asynchronously (#174)

This commit is contained in:
hiroki osame
2023-03-27 05:44:16 -04:00
committed by GitHub
parent a0db0f3ece
commit e431444f95
7 changed files with 193 additions and 187 deletions

View File

@@ -1,15 +1,11 @@
import fs from 'fs/promises';
import path from 'path';
import { testSuite, expect } from 'manten';
import { createFixture } from 'fs-fixture';
import { createAicommits } from '../utils.js';
import { createFixture } from '../utils.js';
export default testSuite(({ describe }) => {
describe('config', async ({ test }) => {
const fixture = await createFixture();
const aicommits = createAicommits({
home: fixture.path,
});
const { fixture, aicommits } = await createFixture();
const configPath = path.join(fixture.path, '.aicommits');
const openAiToken = 'OPENAI_KEY=sk-abc';