Skip to content

Commit

Permalink
test: remove portal-client
Browse files Browse the repository at this point in the history
  • Loading branch information
hanna-skryl committed Oct 24, 2024
1 parent 2d1d772 commit 61af9e1
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions e2e/nx-plugin-e2e/tests/executor-cli.e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import {
type Tree,
addDependenciesToPackageJson,
readJsonFile as readPackageJsonFile,
removeDependenciesFromPackageJson,
updateProjectConfiguration,
} from '@nx/devkit';
import { type Tree, updateProjectConfiguration } from '@nx/devkit';
import { join, relative } from 'node:path';
import { fileURLToPath } from 'node:url';
import { readProjectConfiguration } from 'nx/src/generators/utils/project-configuration';
import type { PackageJson } from 'nx/src/utils/package-json';
import { afterEach, expect } from 'vitest';
import { generateCodePushupConfig } from '@code-pushup/nx-plugin';
import {
Expand Down Expand Up @@ -65,36 +57,17 @@ async function addTargetToWorkspace(
await materializeTree(tree, cwd);
}

const getPortalClientVersion = (): string => {
const projectRoot = join(fileURLToPath(import.meta.url), '../../../../');
const packageJsonPath = join(projectRoot, 'package.json');
return (
readPackageJsonFile<PackageJson>(packageJsonPath).dependencies?.[
'@code-pushup/portal-client'
] || '^0.9.0'
);
};

describe('executor command', () => {
let tree: Tree;
const project = 'my-lib';
const baseDir = 'tmp/e2e/nx-plugin-e2e/__test__/executor/cli';
const portalClientVersion = getPortalClientVersion();

beforeEach(async () => {
tree = await generateWorkspaceAndProject(project);

// @code-pushup/portal-client is required by the executor to handle the upload in tests
addDependenciesToPackageJson(
tree,
{ '@code-pushup/portal-client': portalClientVersion },
{},
);
});

afterEach(async () => {
await teardownTestFolder(baseDir);
removeDependenciesFromPackageJson(tree, ['@code-pushup/portal-client'], []);
});

it('should execute no specific command by default', async () => {
Expand Down

0 comments on commit 61af9e1

Please sign in to comment.