Skip to content

Commit 67d997a

Browse files
committed
feat(config): defined a dependency on the provided prettier config
1 parent adc47cc commit 67d997a

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/scaffolder-test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import scaffold from './scaffolder';
55

66
suite('scaffolder', () => {
77
test('that prettier is scaffolded if config is provided', async () => {
8-
const {devDependencies} = await scaffold({config: {scope: `@${any.word()}`}});
8+
const scope = `@${any.word()}`;
99

10-
assert.deepEqual(devDependencies, ['prettier']);
10+
const {devDependencies} = await scaffold({config: {scope}});
11+
12+
assert.deepEqual(devDependencies, ['prettier', `${scope}/prettier-config`]);
1113
});
1214

1315
test('that prettier is not scaffolded if no config is provided', async () => {

src/scaffolder.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default function ({config}) {
22
if (!config) return {};
33

4-
return {devDependencies: ['prettier']};
4+
return {devDependencies: ['prettier', `${config.scope}/prettier-config`]};
55
}

test/integration/features/step_definitions/dependencies-steps.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ Then('the dependencies are defined', async function () {
55
const {devDependencies} = this.scaffoldResult;
66

77
assert.include(devDependencies, 'prettier');
8+
assert.include(devDependencies, `${this.scope}/prettier-config`);
89
});

0 commit comments

Comments
 (0)