Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit de2eaa3

Browse files
committed
test(cypress): updated cypress types
1 parent 2fea369 commit de2eaa3

File tree

6 files changed

+50
-19
lines changed

6 files changed

+50
-19
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"workspaces": [
99
"packages/*",
1010
"tooling/*",
11-
"website"
11+
"website",
12+
"tests"
1213
],
1314
"scripts": {
1415
"pkg": "manypkg run",

tests/index.d.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
import { mount } from '@cypress/vue'
44

5-
declare namespace Cypress {
6-
export interface Chainable {
7-
mount(): ReturnType<typeof mount>
8-
/**
9-
* Run a11y tests or only a subset of all tests
10-
* @see https://github.com/avanslaars/cypress-axe
11-
* @example
12-
* cy.checkA11y()
13-
*/
14-
checkA11y(any, object): Chainable
5+
declare global {
6+
namespace Cypress {
7+
export interface Chainable {
8+
mount(): ReturnType<typeof mount>
9+
/**
10+
* Run a11y tests or only a subset of all tests
11+
* @see https://github.com/avanslaars/cypress-axe
12+
* @example
13+
* cy.checkA11y()
14+
*/
15+
checkA11y(any, object): Chainable
16+
}
1517
}
1618
}

tests/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "@chakra-ui/vue-cypress-tests",
3+
"version": "0.1.0-alpha.2",
4+
"main": "./support.tsx",
5+
"typings": "index.d.ts",
6+
"files": [
7+
"."
8+
],
9+
"description": "Chakra UI Vue | Cypress Tests setup package",
10+
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next",
11+
"author": "Jonathan Bakebwa [email protected]",
12+
"license": "MIT"
13+
}

tests/support.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
1+
/// <reference types="cypress" />
2+
13
import { mount as cyMount } from '@cypress/vue'
24
import { feActivity } from 'feather-icons-paths'
35
import { MotionPlugin } from '@vueuse/motion'
4-
import { h, Fragment } from 'vue'
6+
import { h, Fragment, Component } from 'vue'
57

68
import ChakraUIVuePlugin, { chakra } from '@chakra-ui/vue-next'
79
import { domElements } from '@chakra-ui/vue-system'
810
import { CReset } from '@chakra-ui/c-reset'
911

12+
13+
declare global {
14+
namespace Cypress {
15+
interface cy extends Chainable {
16+
mount(component: Component, options?: any): ReturnType<typeof cyMount>
17+
/**
18+
* Run a11y tests or only a subset of all tests
19+
* @see https://github.com/avanslaars/cypress-axe
20+
* @example
21+
* cy.checkA11y()
22+
*/
23+
checkA11y(noop?: any): Chainable
24+
}
25+
}
26+
}
27+
28+
1029
import './env' // stub process.env
1130
import './a11y' // checkA11y and axeCore configuration
1231
import './styles' // root stylesheet

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
55
"resolveJsonModule": true,
66
"lib": [ "esnext", "dom" ],
7-
"types": ["node", "jest", "vite/client", "vite-plugin-pages/client", "cypress", "./tests"],
7+
"types": ["node", "jest", "vite/client", "vite-plugin-pages/client", "cypress", "@chakra-ui/vue-cypress-tests"],
88
"declaration": true,
99
"allowJs": true,
1010
"sourceMap": true,
@@ -27,7 +27,8 @@
2727
"playground/**/*.ts",
2828
"playground/**/*.d.ts",
2929
"playground/**/*.tsx",
30-
"playground/**/*.vue"
30+
"playground/**/*.vue",
31+
"@chakra-ui/vue-cypress-tests"
3132
],
3233
"exclude": ["node_modules", "./@types", "dist"],
3334
"ts-node": {

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6930,11 +6930,6 @@ [email protected]:
69306930
resolved "https://registry.yarnpkg.com/folktale/-/folktale-2.3.2.tgz#38231b039e5ef36989920cbf805bf6b227bf4fd4"
69316931
integrity sha512-+8GbtQBwEqutP0v3uajDDoN64K2ehmHd0cjlghhxh0WpcfPzAIjPA03e1VvHlxL02FVGR0A6lwXsNQKn3H1RNQ==
69326932

6933-
follow-redirects@^1.10.0:
6934-
version "1.13.3"
6935-
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.3.tgz#e5598ad50174c1bc4e872301e82ac2cd97f90267"
6936-
integrity sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==
6937-
69386933
for-in@^1.0.2:
69396934
version "1.0.2"
69406935
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"

0 commit comments

Comments
 (0)