Skip to content

Commit

Permalink
fix(web-test-runner): don't use package manager command
Browse files Browse the repository at this point in the history
  • Loading branch information
robby rabbitman committed Jun 29, 2024
1 parent e1cd9de commit fdf70a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/web-test-runner/src/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('@robby-rabbitman/nx-plus-web-test-runner-plugin', () => {
targets: {
test: {
command:
'pnpm exec wtr --config=some/directory/web-test-runner.config.js',
'web-test-runner --config=some/directory/web-test-runner.config.js',
},
},
},
Expand All @@ -118,7 +118,7 @@ describe('@robby-rabbitman/nx-plus-web-test-runner-plugin', () => {
targets: {
test: {
command:
'pnpm exec wtr --config=some/directory/web-test-runner.config.js',
'web-test-runner --config=some/directory/web-test-runner.config.js',
},
},
},
Expand Down Expand Up @@ -150,7 +150,7 @@ describe('@robby-rabbitman/nx-plus-web-test-runner-plugin', () => {
targets: {
'web-test-runner-test': {
command:
'pnpm exec wtr --config=some/directory/web-test-runner.config.js',
'web-test-runner --config=some/directory/web-test-runner.config.js',
},
},
},
Expand Down
7 changes: 2 additions & 5 deletions packages/web-test-runner/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
CreateNodesFunction,
CreateNodesV2,
createNodesFromFiles,
getPackageManagerCommand,
} from '@nx/devkit';
import { existsSync } from 'node:fs';
import { dirname, join } from 'node:path';
Expand All @@ -16,9 +15,7 @@ export type WebTestRunnerTargetPluginOptions = {
const webTestRunnerConfigFileNameGlob =
'**/@(web-test-runner|wtr).config.@(js|cjs|mjs)';

const webTestRunnerCommand = 'wtr';

const packageManagerCommand = getPackageManagerCommand();
const webTestRunnerCommand = 'web-test-runner';

const defaultTargetName = 'test';

Expand Down Expand Up @@ -57,7 +54,7 @@ const createWebTestRunnerTarget: CreateNodesFunction<
[webTestRunnerConfigDirectory]: {
targets: {
[targetName]: {
command: `${packageManagerCommand.exec} ${webTestRunnerCommand} --config=${webTestRunnerConfigPath}`,
command: `${webTestRunnerCommand} --config=${webTestRunnerConfigPath}`,
},
},
},
Expand Down

0 comments on commit fdf70a2

Please sign in to comment.