Skip to content

Commit

Permalink
fix(cy): use cypress-vite to build cypress tests
Browse files Browse the repository at this point in the history
took the `configFile: false` from nextcloud/forms.

Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed May 14, 2024
1 parent b63c513 commit 9da2f3f
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 13 deletions.
7 changes: 6 additions & 1 deletion cypress.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { defineConfig } from 'cypress'
import cypressSplit from 'cypress-split'
import { configureVisualRegression } from 'cypress-visual-regression/dist/plugin.js'

import vitePreprocessor from 'cypress-vite'
import vue from '@vitejs/plugin-vue2'

export default defineConfig({
projectId: 'hx9gqy',
Expand All @@ -20,6 +21,10 @@ export default defineConfig({
visualRegressionType: 'regression',
},
setupNodeEvents(on, config) {
on('file:preprocessor', vitePreprocessor({
plugins: [vue()],
configFile: false,
}))
cypressSplit(on, config)
configureVisualRegression(on)

Expand Down
5 changes: 4 additions & 1 deletion cypress/e2e/nodes/ListItem.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ import TaskItem from './../../../src/nodes/TaskItem.js'
import BulletList from './../../../src/nodes/BulletList.js'
import Markdown from './../../../src/extensions/Markdown.js'
import { createCustomEditor } from './../../support/components.js'
import testData from '../../fixtures/ListItem.md'
import { loadMarkdown, runCommands, expectMarkdown } from './helpers.js'

// https://github.com/import-js/eslint-plugin-import/issues/1739
/* eslint-disable-next-line import/no-unresolved */
import testData from '../../fixtures/ListItem.md?raw'

describe('ListItem extension integrated in the editor', () => {

const editor = createCustomEditor({
Expand Down
5 changes: 4 additions & 1 deletion cypress/e2e/nodes/Preview.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ import Markdown from './../../../src/extensions/Markdown.js'
import Preview from './../../../src/nodes/Preview.js'
import { Italic, Link } from './../../../src/marks/index.js'
import { createCustomEditor } from './../../support/components.js'
import testData from '../../fixtures/Preview.md'
import { loadMarkdown, runCommands, expectMarkdown } from './helpers.js'

// https://github.com/import-js/eslint-plugin-import/issues/1739
/* eslint-disable-next-line import/no-unresolved */
import testData from '../../fixtures/Preview.md?raw'

describe('Preview extension', { retries: 0 }, () => {

const editor = createCustomEditor({
Expand Down
4 changes: 3 additions & 1 deletion cypress/e2e/nodes/Table.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import markdownit from './../../../src/markdownit/index.js'
import EditableTable from './../../../src/nodes/EditableTable.js'
import Markdown, { createMarkdownSerializer } from './../../../src/extensions/Markdown.js'

import testData from '../../fixtures/Table.md'
// https://github.com/import-js/eslint-plugin-import/issues/1739
/* eslint-disable-next-line import/no-unresolved */
import testData from '../../fixtures/Table.md?raw'

const user = randUser()
const fileName = 'empty.md'
Expand Down
34 changes: 25 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"cypress": "^13.9.0",
"cypress-split": "^1.23.2",
"cypress-visual-regression": "^5.0.0",
"cypress-vite": "^1.5.0",
"eslint-plugin-cypress": "^3.2.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
Expand Down

0 comments on commit 9da2f3f

Please sign in to comment.