Skip to content

Commit

Permalink
chore(repo): fix hanging test
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Apr 4, 2024
1 parent 4fd0612 commit 1647d55
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
17 changes: 15 additions & 2 deletions packages/devkit/src/utils/convert-nx-executor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@ import { TempFs } from '../../internal-testing-utils';
import { convertNxExecutor } from './convert-nx-executor';

describe('Convert Nx Executor', () => {
let fs: TempFs;

beforeAll(async () => {
fs = new TempFs('convert-nx-executor');
// The tests in this file don't actually care about the files in the temp dir.
// The converted executor reads project configuration from the workspace root,
// which is set to the temp dir in the tests. If there are no files in the temp
// dir, the glob search currently hangs. So we create a dummy file to prevent that.
await fs.createFile('blah.json', JSON.stringify({}));
});

afterAll(() => {
fs.cleanup();
});

it('should convertNxExecutor to builder correctly and produce the same output', async () => {
const fs = new TempFs('convert-nx-executor');
// ARRANGE
const { schema } = require('@angular-devkit/core');
const {
Expand Down Expand Up @@ -89,7 +103,6 @@ describe('Convert Nx Executor', () => {
expect(convertedExecutor.handler.toString()).toEqual(
realBuilder.handler.toString()
);
fs.cleanup();
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,7 @@ export async function retrieveProjectConfigurationsWithAngularProjects(
workspaceRoot
);

const res = _retrieveProjectConfigurations(
workspaceRoot,
nxJson,
await plugins
);
const res = _retrieveProjectConfigurations(workspaceRoot, nxJson, plugins);
cleanup();
return res;
}
Expand Down

0 comments on commit 1647d55

Please sign in to comment.