@@ -1,3 +1,4 @@
|
||||
import path from 'path';
|
||||
import { testSuite, expect } from 'manten';
|
||||
import {
|
||||
assertOpenAiToken,
|
||||
@@ -22,6 +23,25 @@ export default testSuite(({ describe }) => {
|
||||
await fixture.rm();
|
||||
});
|
||||
|
||||
test('installs from Git repo subdirectory', async () => {
|
||||
const { fixture, aicommits } = await createFixture({
|
||||
...files,
|
||||
'some-dir': {
|
||||
'file.txt': '',
|
||||
},
|
||||
});
|
||||
await createGit(fixture.path);
|
||||
|
||||
const { stdout } = await aicommits(['hook', 'install'], {
|
||||
cwd: path.join(fixture.path, 'some-dir'),
|
||||
});
|
||||
expect(stdout).toMatch('Hook installed');
|
||||
|
||||
expect(await fixture.exists('.git/hooks/prepare-commit-msg')).toBe(true);
|
||||
|
||||
await fixture.rm();
|
||||
});
|
||||
|
||||
test('Commits', async () => {
|
||||
const { fixture, aicommits } = await createFixture(files);
|
||||
const git = await createGit(fixture.path);
|
||||
|
||||
@@ -19,8 +19,8 @@ const createAicommits = (fixture: FsFixture) => {
|
||||
args?: string[],
|
||||
options?: Options,
|
||||
) => execaNode(aicommitsPath, args, {
|
||||
...options,
|
||||
cwd: fixture.path,
|
||||
...options,
|
||||
extendEnv: false,
|
||||
env: {
|
||||
...homeEnv,
|
||||
|
||||
Reference in New Issue
Block a user