diff --git a/cypress.config.mjs b/cypress.config.mjs index f77cc6adca9..dea25c3416a 100644 --- a/cypress.config.mjs +++ b/cypress.config.mjs @@ -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', @@ -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) diff --git a/cypress/e2e/nodes/ListItem.spec.js b/cypress/e2e/nodes/ListItem.spec.js index 62a98cb2ba6..9295fdaee9d 100644 --- a/cypress/e2e/nodes/ListItem.spec.js +++ b/cypress/e2e/nodes/ListItem.spec.js @@ -7,7 +7,7 @@ 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 testData from '../../fixtures/ListItem.md?raw' import { loadMarkdown, runCommands, expectMarkdown } from './helpers.js' describe('ListItem extension integrated in the editor', () => { diff --git a/cypress/e2e/nodes/Preview.spec.js b/cypress/e2e/nodes/Preview.spec.js index 74d3c41d893..bf950db782d 100644 --- a/cypress/e2e/nodes/Preview.spec.js +++ b/cypress/e2e/nodes/Preview.spec.js @@ -25,7 +25,7 @@ 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 testData from '../../fixtures/Preview.md?raw' import { loadMarkdown, runCommands, expectMarkdown } from './helpers.js' describe('Preview extension', { retries: 0 }, () => { diff --git a/cypress/e2e/nodes/Table.spec.js b/cypress/e2e/nodes/Table.spec.js index d104b9fa22f..73c6b4b1201 100644 --- a/cypress/e2e/nodes/Table.spec.js +++ b/cypress/e2e/nodes/Table.spec.js @@ -6,7 +6,7 @@ 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' +import testData from '../../fixtures/Table.md?raw' const user = randUser() const fileName = 'empty.md' diff --git a/package-lock.json b/package-lock.json index f8884682029..f0470c6d975 100644 --- a/package-lock.json +++ b/package-lock.json @@ -102,6 +102,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", @@ -7424,7 +7425,6 @@ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -7953,7 +7953,6 @@ "url": "https://paulmillr.com/funding/" } ], - "peer": true, "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -8737,6 +8736,19 @@ "cypress": ">=12" } }, + "node_modules/cypress-vite": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/cypress-vite/-/cypress-vite-1.5.0.tgz", + "integrity": "sha512-vvTMqJZgI3sN2ylQTi4OQh8LRRjSrfrIdkQD5fOj+EC/e9oHkxS96lif1SyDF1PwailG1tnpJE+VpN6+AwO/rg==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.3", + "debug": "^4.3.4" + }, + "peerDependencies": { + "vite": "^2.9.0 || ^3.0.0 || ^4.0.0 || ^5.0.0" + } + }, "node_modules/cypress/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -12975,7 +12987,6 @@ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, - "peer": true, "dependencies": { "binary-extensions": "^2.0.0" }, @@ -22599,7 +22610,6 @@ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, - "peer": true, "dependencies": { "picomatch": "^2.2.1" }, @@ -33401,8 +33411,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "peer": true + "dev": true }, "bl": { "version": "4.1.0", @@ -33800,7 +33809,6 @@ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, - "peer": true, "requires": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -34517,6 +34525,16 @@ "winston": "^3.10.0" } }, + "cypress-vite": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/cypress-vite/-/cypress-vite-1.5.0.tgz", + "integrity": "sha512-vvTMqJZgI3sN2ylQTi4OQh8LRRjSrfrIdkQD5fOj+EC/e9oHkxS96lif1SyDF1PwailG1tnpJE+VpN6+AwO/rg==", + "dev": true, + "requires": { + "chokidar": "^3.5.3", + "debug": "^4.3.4" + } + }, "cytoscape": { "version": "3.28.1", "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.28.1.tgz", @@ -37595,7 +37613,6 @@ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, - "peer": true, "requires": { "binary-extensions": "^2.0.0" } @@ -43934,7 +43951,6 @@ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, - "peer": true, "requires": { "picomatch": "^2.2.1" } diff --git a/package.json b/package.json index 60098e875ed..279ae806fc3 100644 --- a/package.json +++ b/package.json @@ -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",