Skip to content

Commit f917275

Browse files
authored
Merge pull request #1489 from form8ion/beta
2 parents 9499626 + fa2fac4 commit f917275

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

src/lift.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ import deepmerge from 'deepmerge';
22
import {applyEnhancers} from '@form8ion/core';
33
import {lift as liftReadme} from '@form8ion/readme';
44

5+
import {test as gitIgnoreExists, lift as liftGitignore} from './vcs/git/ignore/index.js';
6+
57
export default async function ({projectRoot, results, enhancers, vcs}) {
6-
const enhancerResults = await applyEnhancers({results, enhancers, options: {projectRoot, vcs}});
8+
const enhancerResults = await applyEnhancers({
9+
results,
10+
enhancers: {...enhancers, gitIgnore: {test: gitIgnoreExists, lift: liftGitignore}},
11+
options: {projectRoot, vcs}
12+
});
713

814
await liftReadme({projectRoot, results: deepmerge.all([results, enhancerResults])});
915

src/lift.test.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {afterEach, describe, expect, it, vi} from 'vitest';
66
import any from '@travi/any';
77
import {when} from 'jest-when';
88

9+
import {lift as liftGitignore, test as gitIgnoreExists} from './vcs/git/ignore/index.js';
910
import lift from './lift.js';
1011

1112
vi.mock('deepmerge');
@@ -25,7 +26,11 @@ describe('lift', () => {
2526
const enhancerResults = any.simpleObject();
2627
const mergedResults = any.simpleObject();
2728
when(core.applyEnhancers)
28-
.calledWith({results, enhancers, options: {projectRoot, vcs}})
29+
.calledWith({
30+
results,
31+
enhancers: {...enhancers, gitIgnore: {test: gitIgnoreExists, lift: liftGitignore}},
32+
options: {projectRoot, vcs}
33+
})
2934
.mockResolvedValue(enhancerResults);
3035
when(deepmerge.all).calledWith([results, enhancerResults]).mockReturnValue(mergedResults);
3136

test/integration/features/git.feature

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Feature: Git Repository
2626
Then the base git files should be present
2727
And the additional ignores are added to the gitignore
2828

29-
@wip
3029
Scenario: already versioned without an existing gitignore
3130
Given the project root is already initialized as a git repository
3231
And a language scaffolder is chosen

test/integration/features/lift/git/ignore.feature

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Feature: Gitignore
55
When the project is lifted
66
Then the gitignore file is unchanged
77

8-
@wip
98
Scenario: additional directories and files
109
Given additional directories are provided to be ignored from vcs
1110
And additional files are provided to be ignored from vcs

test/integration/features/step_definitions/vcs/git-steps.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,6 @@ Then('the gitignore file is unchanged', async function () {
114114
Then('the gitignore file is added', async function () {
115115
assert.equal(
116116
await fs.readFile(`${process.cwd()}/.gitignore`, 'utf-8'),
117-
`${this.vcsIgnoreDirectories.join('\n')}\n\n${this.vcsIgnoreFiles.join('\n')}`
117+
`\n${this.vcsIgnoreDirectories.join('\n')}\n\n${this.vcsIgnoreFiles.join('\n')}`
118118
);
119119
});

0 commit comments

Comments
 (0)