Skip to content

Commit 39d4077

Browse files
authored
Merge pull request #3 from qwikifiers/pr-cleanup
2 parents fb97cd4 + 990726b commit 39d4077

File tree

12 files changed

+6829
-2307
lines changed

12 files changed

+6829
-2307
lines changed

.github/actions/test/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ runs:
1414
shell: bash
1515
run: npx nx affected:lint --base=last-release
1616

17-
# - name: Test
18-
# shell: bash
19-
# run: npx nx affected --target=ct --base=last-release
17+
- name: Test
18+
shell: bash
19+
run: npx nx affected --target=ct --base=last-release
2020

2121
# - name: E2E Tests
2222
# shell: bash
2323
# run: npx nx affected --target=e2e --base=last-release
2424

25-
# - name: Codecov upload
26-
# uses: codecov/codecov-action@v2
25+
# - name: Codecov upload
26+
# uses: codecov/codecov-action@v2

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
- [Related Links](#related-links)
3636
- [License](#license)
3737

38-
3938
## Installation
4039

4140
```console
@@ -57,7 +56,16 @@ export default defineConfig({
5756
} as any,
5857
},
5958
});
59+
```
60+
61+
Add `addQwikLoader` to the `component.ts` file -
62+
63+
```ts
64+
// component.ts
6065

66+
import { addQwikLoader } from 'cypress-ct-qwik';
67+
68+
addQwikLoader();
6169
```
6270

6371
## Usage
@@ -69,16 +77,12 @@ import { mount } from 'cypress-ct-qwik';
6977
import MyComp from './my-comp';
7078

7179
describe(`Qwik Component Test`, () => {
72-
7380
it('should find my link', () => {
74-
7581
mount(<MyComp />);
7682

7783
cy.contains('myLink').should('exist');
7884
});
7985
});
80-
81-
8286
```
8387

8488
<br/>
@@ -131,7 +135,6 @@ This project follows the [all-contributors](https://github.com/all-contributors/
131135
- [Qwik Docs](https://qwik.builder.io/)
132136
- [Cypress Docs](https://www.cypress.io/)
133137

134-
135138
## License
136139

137140
MIT

apps/qwik-app/cypress/support/component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
// https://on.cypress.io/configuration
1414
// ***********************************************************
1515

16+
import { addQwikLoader } from 'cypress-ct-qwik';
1617
// Import commands.ts using ES2015 syntax:
1718
import './commands';
19+
20+
addQwikLoader();

apps/qwik-app/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969
"executor": "@nrwl/cypress:cypress",
7070
"options": {
7171
"cypressConfig": "apps/qwik-app/cypress.config.ts",
72-
"testingType": "component"
72+
"testingType": "component",
73+
"skipServe": true
7374
}
7475
}
7576
},

apps/qwik-app/src/components/header/header.cy.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,12 @@ describe(`header component test`, () => {
77

88
cy.contains(/docs/i).should('exist');
99
});
10+
11+
it('should click on a button', () => {
12+
mount(<Header />);
13+
14+
cy.contains(/opened/i).should('not.exist');
15+
cy.contains(/click me/i).click();
16+
cy.contains(/opened/i).should('exist');
17+
});
1018
});

apps/qwik-app/src/components/header/header.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
1-
import { component$, useStylesScoped$ } from '@builder.io/qwik';
1+
import { component$, useSignal, useStylesScoped$ } from '@builder.io/qwik';
22
import { QwikLogo } from '../icons/qwik';
33
import styles from './header.css?inline';
44

55
export default component$(() => {
66
useStylesScoped$(styles);
77

8+
const isOpenSignal = useSignal(false);
9+
810
return (
911
<header>
1012
<div class="logo">
1113
<a href="https://qwik.builder.io/" target="_blank">
1214
<QwikLogo />
1315
</a>
1416
</div>
17+
<div>
18+
<button
19+
onClick$={() => {
20+
isOpenSignal.value = true;
21+
}}
22+
>
23+
Click Me
24+
</button>
25+
26+
{isOpenSignal.value && <div>Opened</div>}
27+
</div>
1528
<ul>
1629
<li>
1730
<a

migrations.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"migrations": [
3+
{
4+
"version": "0.11.0",
5+
"description": "switch-to-qwik-nx-build-executor",
6+
"cli": "nx",
7+
"implementation": "./src/migrations/switch-to-qwik-nx-build-executor/switch-to-qwik-nx-build-executor",
8+
"package": "qwik-nx",
9+
"name": "switch-to-qwik-nx-build-executor"
10+
},
11+
{
12+
"version": "0.13.1",
13+
"description": "useClientEffect$ has been changed to useVisisbleTask$",
14+
"cli": "nx",
15+
"implementation": "./src/migrations/update-use-client-effect$-to-use-visisble-task$/update-use-client-effect$-to-use-visisble-task$",
16+
"package": "qwik-nx",
17+
"name": "update-use-client-effect$-to-use-visisble-task$"
18+
}
19+
]
20+
}

package.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,55 +12,55 @@
1212
"prepare": "husky install"
1313
},
1414
"devDependencies": {
15-
"@builder.io/qwik": "0.18.1",
16-
"@builder.io/qwik-city": "0.2.1",
15+
"@builder.io/qwik": "0.23.0",
16+
"@builder.io/qwik-city": "0.6.6",
1717
"@commitlint/cli": "^17.4.3",
1818
"@commitlint/config-angular": "^17.4.3",
1919
"@commitlint/config-conventional": "^17.4.3",
2020
"@cypress/code-coverage": "3.10.0",
2121
"@cypress/vite-dev-server": "^2.2.1",
2222
"@jscutlery/semver": "^2.30.1",
23-
"@nrwl/cli": "15.7.0",
24-
"@nrwl/cypress": "15.7.0",
25-
"@nrwl/eslint-plugin-nx": "15.7.0",
26-
"@nrwl/js": "15.7.0",
27-
"@nrwl/linter": "15.7.0",
28-
"@nrwl/nx-cloud": "15.0.3",
29-
"@nrwl/vite": "15.7.0",
30-
"@nrwl/workspace": "15.7.0",
31-
"@types/eslint": "8.21.1",
32-
"@types/node": "18.13.0",
33-
"@typescript-eslint/eslint-plugin": "5.52.0",
34-
"@typescript-eslint/parser": "5.52.0",
23+
"@nrwl/cli": "15.8.9",
24+
"@nrwl/cypress": "15.8.9",
25+
"@nrwl/eslint-plugin-nx": "15.8.9",
26+
"@nrwl/js": "15.8.9",
27+
"@nrwl/linter": "15.8.9",
28+
"@nrwl/nx-cloud": "15.3.2",
29+
"@nrwl/vite": "15.8.9",
30+
"@nrwl/workspace": "15.8.9",
31+
"@types/eslint": "8.21.3",
32+
"@types/node": "18.15.3",
33+
"@typescript-eslint/eslint-plugin": "5.56.0",
34+
"@typescript-eslint/parser": "5.56.0",
3535
"@vitest/ui": "^0.25.8",
3636
"all-contributors-cli": "^6.24.0",
3737
"autoprefixer": "^10.4.13",
3838
"commitizen": "^4.3.0",
3939
"commitlint": "^17.4.3",
4040
"cypress": "^12.5.1",
4141
"cz-conventional-changelog": "^3.3.0",
42-
"eslint": "8.34.0",
42+
"eslint": "8.36.0",
4343
"eslint-config-prettier": "8.6.0",
4444
"eslint-plugin-cypress": "^2.12.1",
45-
"eslint-plugin-qwik": "0.18.1",
45+
"eslint-plugin-qwik": "0.23.0",
4646
"html-webpack-plugin": "^5.5.0",
4747
"husky": "^8.0.3",
4848
"jsdom": "~21.1.0",
4949
"ngx-deploy-npm": "^5.0.0",
5050
"node-fetch": "3.3.0",
5151
"np": "7.6.3",
52-
"nx": "15.7.0",
52+
"nx": "15.8.9",
5353
"postcss": "^8.4.21",
54-
"prettier": "2.8.4",
54+
"prettier": "2.8.6",
5555
"pretty-quick": "^3.1.3",
56-
"qwik-nx": "0.10.0",
56+
"qwik-nx": "0.14.0",
5757
"ts-node": "10.9.1",
58-
"typescript": "4.9.5",
59-
"undici": "5.19.1",
60-
"vite": "4.1.1",
58+
"typescript": "5.0.2",
59+
"undici": "5.21.0",
60+
"vite": "4.1.2",
6161
"vite-plugin-dts": "~1.7.3",
6262
"vite-plugin-eslint": "^1.8.1",
63-
"vite-tsconfig-paths": "4.0.5",
63+
"vite-tsconfig-paths": "4.0.7",
6464
"vitest": "^0.25.8"
6565
},
6666
"config": {

packages/cypress-ct-qwik/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
export * from './lib/add-qwik-loader';
12
export * from './lib/mount';
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { QWIK_LOADER } from '@builder.io/qwik/loader';
2+
3+
export function addQwikLoader() {
4+
const scriptEl = document.createElement('script');
5+
const inlineScript = document.createTextNode(QWIK_LOADER);
6+
scriptEl.appendChild(inlineScript);
7+
document.body.appendChild(scriptEl);
8+
}

0 commit comments

Comments
 (0)