Skip to content
Snippets Groups Projects
Commit 30a7e0e3 authored by Sky Brewer's avatar Sky Brewer
Browse files

Update cypress to use vite

parent 26679d4f
No related branches found
No related tags found
1 merge request!172CE-2806: Add vite
const { defineConfig } = require("cypress");
import { defineConfig } from "cypress";
module.exports = defineConfig({
export default defineConfig({
component: {
viewportHeight: 500,
viewportWidth: 1000,
......@@ -8,8 +8,8 @@ module.exports = defineConfig({
'src/**/*.cy.{js,jsx,ts,tsx}'
],
devServer: {
framework: "create-react-app",
bundler: "webpack"
framework: "react",
bundler: "vite"
}
}
});
......@@ -45,16 +45,14 @@ function withMockPagination({ req, data, key }) {
// handler to return the OpenAPI spec
function spec() {
const data = spec_data;
return {
body: data
body: spec_data
};
}
function get_host(req) {
const data = hosts_data;
const params = getParameters(req, "/hosts/:id");
const body = data.find((x) => x.id === Number(params.id));
const body = hosts_data.find((x) => x.id === Number(params.id));
if (body) {
return { body };
} else {
......@@ -63,15 +61,14 @@ function get_host(req) {
}
function list_hosts(req) {
const hostData = hosts_data;
const {
// page = 0,
// limit = 10,
query = ""
} = Object.fromEntries(searchParams(req));
const filteredData = query
? hostData.filter((h) => h.name.includes(query))
: hostData;
? hosts_data.filter((h) => h.name.includes(query))
: hosts_data;
const { data, ...rest } = withMockPagination({ req, data: filteredData });
return {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment