https://cypress.io logo
How can i import my standard vue app in my tests?
# i-need-help
h
I have a bunch of plugins and config and stuff. I don't want to have to duplicate it. like
Copy code
ts
// cypress/support/component.ts
import "./commands";
import { mount } from "cypress/vue";
import { app } from "../src/main.js";

// do something with `app` so it's actually used

Cypress.Commands.add('mount', mount)
my vue app, for context
Copy code
js
import App from "./App.vue";
import { createApp } from "vue";
import VueSortable from "vue3-sortablejs";

// icons
import "@mdi/font/css/materialdesignicons.css";
import "@fortawesome/fontawesome-free/css/all.css";
import { aliases, fa } from "vuetify/iconsets/fa";
import { mdi } from "vuetify/iconsets/mdi";

// vuetify
import "vuetify/styles";
import * as components from "vuetify/components";
import * as directives from "vuetify/directives";
import colors from "vuetify/lib/util/colors";
import { createVuetify } from "vuetify";

// needs to be below vuetify
import "./assets/main.scss";
import "./assets/print.scss";
// start loading
import "./globals";

const app = createApp(App);
app.use(VueSortable);
const vuetify = createVuetify({
    components: components,
    directives: directives,
    display: {
        mobileBreakpoint: "md",
    },
    theme: {
        defaultTheme: "dark",
        themes: {
            // like 50 lines skipped
        },
    },
    icons: {
        defaultSet: "fa",
        aliases,
        sets: { fa, mdi }
    }
});
app.use(vuetify);

app.mount("#app");
most of my components don't render at all without vuetify
(a) there's a dozen ts complaints (b)

https://cdn.discordapp.com/attachments/1104045811744124988/1104599773073383495/image.png

3 Views