Skip to content

Commit 875038b

Browse files
committed
refactor: added qwikloader to mount
1 parent ed00b26 commit 875038b

File tree

5 files changed

+109
-125
lines changed

5 files changed

+109
-125
lines changed

README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,7 @@ npm install -D cypress-ct-qwik
4545

4646
1. Run cypress (in watch mode) after installation
4747
2. Follow the configuration wizard
48-
3. Add `addQwikLoader` to the `component.ts` file -
49-
50-
```ts
51-
// component.ts
52-
53-
import { addQwikLoader } from 'cypress-ct-qwik';
54-
55-
addQwikLoader();
56-
```
57-
58-
4. Add the `mount` command to `support/commands.ts` -
48+
3. Add the `mount` command to `support/commands.ts` -
5949

6050
```ts
6151
// commands.ts

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

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

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"autoprefixer": "^10.4.13",
3838
"commitizen": "^4.3.0",
3939
"commitlint": "^17.4.3",
40-
"cypress": "12.8.1",
40+
"cypress": "12.9.0",
4141
"cz-conventional-changelog": "^3.3.0",
4242
"eslint": "8.36.0",
4343
"eslint-config-prettier": "8.6.0",
@@ -57,7 +57,7 @@
5757
"ts-node": "10.9.1",
5858
"typescript": "5.0.2",
5959
"undici": "5.21.0",
60-
"vite": "4.1.2",
60+
"vite": "4.2.1",
6161
"vite-plugin-dts": "~1.7.3",
6262
"vite-plugin-eslint": "^1.8.1",
6363
"vite-tsconfig-paths": "4.0.7",

packages/cypress-ct-qwik/src/lib/mount.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { JSXNode, RenderResult } from '@builder.io/qwik';
22
import { render } from '@builder.io/qwik';
33
import { getContainerEl, setupHooks } from '@cypress/mount-utils';
4+
import { addQwikLoader } from './add-qwik-loader';
45

56
let destroy: () => void | undefined;
67

@@ -9,6 +10,8 @@ function cleanup() {
910
}
1011

1112
export function mount(element: JSXNode) {
13+
addQwikLoader();
14+
1215
const root = getContainerEl();
1316

1417
const renderResultPromise = render(root, element);

0 commit comments

Comments
 (0)