Skip to content

Commit

Permalink
fix(nx-plugin): fix wrong import path in spec file template and e2e t…
Browse files Browse the repository at this point in the history
…ests
  • Loading branch information
leosvelperez committed Oct 31, 2024
1 parent 5e238ae commit bd0e446
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions e2e/plugin/src/nx-plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Nx Plugin', () => {

runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`);
runCLI(
`generate @nx/plugin:migration --path=${plugin}/src/migrations/update-${version} --packageVersion=${version} --packageJsonUpdates=false`
`generate @nx/plugin:migration --path=${plugin}/src/migrations/update-${version}/update-${version} --packageVersion=${version} --packageJsonUpdates=false`
);

const lintResults = runCLI(`lint ${plugin}`);
Expand Down Expand Up @@ -92,7 +92,7 @@ describe('Nx Plugin', () => {

runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`);
runCLI(
`generate @nx/plugin:generator ${plugin}/src/generators/${generator} --name ${generator}`
`generate @nx/plugin:generator ${plugin}/src/generators/${generator}/generator --name ${generator}`
);

const lintResults = runCLI(`lint ${plugin}`);
Expand Down Expand Up @@ -129,7 +129,7 @@ describe('Nx Plugin', () => {

runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`);
runCLI(
`generate @nx/plugin:executor --name ${executor} --path=${plugin}/src/executors/${executor} --includeHasher`
`generate @nx/plugin:executor --name ${executor} --path=${plugin}/src/executors/${executor}/executor --includeHasher`
);

const lintResults = runCLI(`lint ${plugin}`);
Expand Down Expand Up @@ -178,19 +178,19 @@ describe('Nx Plugin', () => {
runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`);

runCLI(
`generate @nx/plugin:generator --name=${goodGenerator} --path=${plugin}/src/generators/${goodGenerator}`
`generate @nx/plugin:generator --name=${goodGenerator} --path=${plugin}/src/generators/${goodGenerator}/generator`
);

runCLI(
`generate @nx/plugin:generator --name=${badFactoryPath} --path=${plugin}/src/generators/${badFactoryPath}`
`generate @nx/plugin:generator --name=${badFactoryPath} --path=${plugin}/src/generators/${badFactoryPath}/generator`
);

runCLI(
`generate @nx/plugin:executor --name=${goodExecutor} --path=${plugin}/src/executors/${goodExecutor}`
`generate @nx/plugin:executor --name=${goodExecutor} --path=${plugin}/src/executors/${goodExecutor}/executor`
);

runCLI(
`generate @nx/plugin:executor --name=${badExecutorBadImplPath} --path=${plugin}/src/executors/${badExecutorBadImplPath}`
`generate @nx/plugin:executor --name=${badExecutorBadImplPath} --path=${plugin}/src/executors/${badExecutorBadImplPath}/executor`
);

runCLI(
Expand Down Expand Up @@ -308,11 +308,11 @@ describe('Nx Plugin', () => {
const generatedProject = uniq('project');

runCLI(
`generate @nx/plugin:generator --name ${generator} --path ${plugin}/src/generators/${generator}`
`generate @nx/plugin:generator --name ${generator} --path ${plugin}/src/generators/${generator}/generator`
);

runCLI(
`generate @nx/plugin:executor --name ${executor} --path ${plugin}/src/executors/${executor}`
`generate @nx/plugin:executor --name ${executor} --path ${plugin}/src/executors/${executor}/executor`
);

updateFile(
Expand Down Expand Up @@ -349,7 +349,7 @@ describe('Nx Plugin', () => {

expect(() => {
runCLI(
`generate @nx/plugin:generator ${plugin}/src/generators/${generator} --name ${generator}`
`generate @nx/plugin:generator ${plugin}/src/generators/${generator}/generator --name ${generator}`
);

runCLI(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ExecutorContext } from '@nx/devkit';

import { <%= className %>ExecutorSchema } from './schema';
import executor from './executor';
import executor from './<%= fileName %>';

const options: <%= className %>ExecutorSchema = {};
const context: ExecutorContext = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
import { Tree, readProjectConfiguration } from '@nx/devkit';

import { <%= generatorFnName %> } from './generator';
import { <%= generatorFnName %> } from './<%= fileName %>';
import { <%= schemaInterfaceName %> } from './schema';

describe('<%= name %> generator', () => {
Expand Down

0 comments on commit bd0e446

Please sign in to comment.