Skip to content

Commit 4424bfd

Browse files
naorpeledshairezmaiieul
authored
fix(cli-e2e): make it great again (#885)
Co-authored-by: Shai Reznik <[email protected]> Co-authored-by: maiieul <[email protected]>
1 parent 50c61ba commit 4424bfd

File tree

4 files changed

+18
-22
lines changed

4 files changed

+18
-22
lines changed

.github/actions/test/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ runs:
3232
# shell: bash
3333
# run: npx nx affected:build --base=last-release --exclude=website
3434

35-
# - name: E2E Tests
36-
# shell: bash
37-
# run: npx nx affected --target=e2e --base=last-release
35+
- name: CLI E2E Tests
36+
shell: bash
37+
run: npx nx e2e cli-e2e
3838

3939
# - name: Codecov upload
4040
# uses: codecov/codecov-action@v2

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"engines": {
66
"node": ">=16.0.0"
77
},
8-
"private": false,
8+
"private": true,
99
"type": "module",
1010
"scripts": {
1111
"build.changelog-formatter": "tsc .changeset/changelog-github-custom.ts && mv .changeset/changelog-github-custom.js .changeset/changelog-github-custom.cjs",
@@ -29,6 +29,7 @@
2929
"release": "pnpm release.prepare && pnpm release.setroot && pnpm release.publish && pnpm release.resetroot",
3030
"release.publish": "changeset publish",
3131
"release.resetroot": "cp dist/pnpm-workspace.yaml pnpm-workspace.yaml",
32+
"release.e2e": "pnpm release.prepare && pnpm release.setroot && pnpm -r exec pnpm version patch && pnpm -r publish --tag e2e --no-git-checks && pnpm release.resetroot",
3233
"test.cli": "NODE_OPTIONS=--experimental-vm-modules nx test cli",
3334
"test.headless": "nx component-test headless --skip-nx-cache",
3435
"test.visual.headless": "nx visual-test headless",

packages/cli-e2e/src/cli.smoke.spec.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@ describe('Qwik UI CLI Smoke test', () => {
2323

2424
it('should be installed and add the button file', () => {
2525
execSync(
26-
'npx -y qwik-ui@0.0.0-e2e init --e2e --projectRoot / --uiComponentsPath "src/components/ui" --rootCssPath "src/global.css" --installTailwind --style "simple" --borderRadius "0" --primaryColor "cyan-600" --components=button',
26+
'npx -y qwik-ui@e2e init --e2e --projectRoot / --uiComponentsPath "src/components/ui" --rootCssPath "src/global.css" --installTailwind --style "simple" --components=button',
2727
{
2828
cwd: projectDirectory,
29-
stdio: 'inherit',
3029
env: process.env,
30+
stdio: 'inherit',
3131
},
3232
);
33+
execSync('npx -y qwik-ui@e2e add button', {
34+
cwd: projectDirectory,
35+
env: process.env,
36+
stdio: 'inherit',
37+
});
3338
const buttonIsInTheRightPlace = existsSync(
3439
join(projectDirectory, 'src/components/ui/button/button.tsx'),
3540
);
@@ -54,7 +59,7 @@ function createTestQwikProject() {
5459
recursive: true,
5560
});
5661

57-
execSync(`pnpm create qwik@latest basic ${projectName}`, {
62+
execSync(`pnpm create qwik@latest empty ${projectName}`, {
5863
cwd: tempDir,
5964
stdio: 'inherit',
6065
env: process.env,

tools/scripts/start-local-registry.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* It is meant to be called in jest's globalSetup.
44
*/
55
import { startLocalRegistry } from '@nx/js/plugins/jest/local-registry';
6-
import { execFileSync } from 'child_process';
6+
import { execSync } from 'child_process';
77

88
export default async () => {
99
// local registry target to run
@@ -16,18 +16,8 @@ export default async () => {
1616
storage,
1717
verbose: false,
1818
});
19-
const nx = require.resolve('nx');
20-
execFileSync(
21-
nx,
22-
[
23-
'run-many',
24-
'--targets',
25-
'publish',
26-
'--package-version',
27-
'0.0.0-e2e',
28-
'--tag',
29-
'e2e',
30-
],
31-
{ env: process.env, stdio: 'inherit' },
32-
);
19+
execSync('pnpm run release.e2e', {
20+
env: process.env,
21+
stdio: 'inherit',
22+
});
3323
};

0 commit comments

Comments
 (0)