Skip to content
This repository has been archived by the owner on Dec 18, 2021. It is now read-only.

Commit

Permalink
Merge pull request #617 from form8ion/alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
travi authored Jun 14, 2021
2 parents 4ec6f8d + 6b89ca0 commit a0375ea
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 24 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
},
"dependencies": {
"@form8ion/core": "^1.3.1",
"@form8ion/eslint": "1.1.0",
"@form8ion/eslint": "1.2.0-alpha.8",
"@form8ion/husky": "1.3.0",
"@form8ion/javascript-core": "^2.9.2",
"@travi/cli-messages": "^1.0.4",
Expand Down
12 changes: 3 additions & 9 deletions src/lift-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ suite('lift', () => {
devDependencies,
packageManager: manager
};
const huskyNextSteps = any.listOf(any.simpleObject);
const huskyLiftResults = {nextSteps: huskyNextSteps};
const huskyLiftResults = {};

setup(() => {
sandbox = sinon.createSandbox();
Expand All @@ -47,17 +46,12 @@ suite('lift', () => {
test('that results specific to js projects are lifted', async () => {
const scope = any.word();
const eslintDevDependencies = any.listOf(any.word);
const eslintNextSteps = any.listOf(any.simpleObject);
const eslintLiftResults = {
...any.simpleObject(),
nextSteps: eslintNextSteps,
devDependencies: eslintDevDependencies
};
const eslintLiftResults = {...any.simpleObject(), devDependencies: eslintDevDependencies};
eslint.lift.withArgs({configs: eslintConfigs, projectRoot}).resolves(eslintLiftResults);

const liftResults = await lift({projectRoot, results, configs: {eslint: {scope}}});

assert.deepEqual(liftResults, {nextSteps: eslintNextSteps});
assert.deepEqual(liftResults, {});
assert.calledWith(
packageLifter.default,
deepmerge(
Expand Down
3 changes: 1 addition & 2 deletions src/lift.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default async function ({
const packageManager = await resolvePackageManager({projectRoot, packageManager: manager});
const huskyResults = await liftHusky({projectRoot, packageManager});
const {
nextSteps,
devDependencies: eslintDevDependencies
} = await liftEslint({projectRoot, configs: eslintConfigs});

Expand All @@ -33,5 +32,5 @@ export default async function ({
)
);

return {nextSteps};
return {};
}
2 changes: 0 additions & 2 deletions test/integration/features/eslint-configs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Feature: ESLint Configs
And additional shareable configs are provided
When the scaffolder results are processed
Then the yaml eslint config file contains the expected config
And the next-steps are provided
And dependencies are defined for the additional configs

Scenario: existing yaml config and complex shareable configs to add
Expand All @@ -31,5 +30,4 @@ Feature: ESLint Configs
And complex additional shareable configs are provided
When the scaffolder results are processed
Then the yaml eslint config file contains the expected config
And the next-steps are provided
And dependencies are defined for the additional configs
19 changes: 12 additions & 7 deletions test/integration/features/step_definitions/eslint-config-steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,19 @@ Then('no eslint config file exists', async function () {
Then('the yaml eslint config file contains the expected config', async function () {
const config = load(await fs.readFile(pathToYamlConfig));

assert.deepEqual(config.extends, eslintConfigScope);
});
if (this.additionalShareableConfigs) {
assert.equal(config.extends[0], eslintConfigScope);
assert.includeMembers(
config.extends,
this.additionalShareableConfigs.map(cfg => {
if ('string' === typeof cfg) return `${eslintConfigScope}/${cfg}`;

Then('the next-steps are provided', async function () {
assert.includeDeepMembers(
this.results.nextSteps,
[{summary: `extend the following additional ESLint configs: ${this.additionalShareableConfigs.join(', ')}`}]
);
return `${eslintConfigScope}/${cfg.name}`;
})
);
} else {
assert.deepEqual(config.extends, eslintConfigScope);
}
});

Then('dependencies are defined for the additional configs', async function () {
Expand Down

0 comments on commit a0375ea

Please sign in to comment.