How to use the @vue/test-utils.config.mocks function in @vue/test-utils

To help you get started, we’ve selected a few @vue/test-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ktmouk / hackaru-desktop / __tests__ / __setups__ / config.js View on Github external
import { config } from '@vue/test-utils';

config.mocks['$t'] = () => {};
config.mocks['$ga'] = { event: () => Promise.resolve() };
github ktmouk / hackaru-desktop / __tests__ / __setups__ / config.js View on Github external
import { config } from '@vue/test-utils';

config.mocks['$t'] = () => {};
config.mocks['$ga'] = { event: () => Promise.resolve() };
github Kitware / CDash / tests / Spec / test-details.spec.js View on Github external
import {mount, config} from "@vue/test-utils";
import axios from 'axios'
import AxiosMockAdapter from 'axios-mock-adapter';
import expect from 'expect';
import TestDetails from "../../resources/js/components/TestDetails.vue";

config.mocks['$baseURL'] = '';
axios.defaults.baseURL = config.mocks['$baseURL'];

import $ from 'jquery'
$.plot = function() { return null; };
$.fn.je_compare = function() { return null; };
global.$ = $

import AnsiUp from 'ansi_up';
global.AnsiUp = AnsiUp

import d3 from 'd3';

describe('TestDetails', function() {
  let component;

  beforeEach(function() {
github Kitware / CDash / tests / Spec / page-header / header-menu.spec.js View on Github external
import {mount, config} from "@vue/test-utils";
config.mocks['$baseURL'] = 'http://localhost';
import HeaderMenu from "../../../resources/js/components/page-header/HeaderMenu.vue";
import expect from 'expect';
import moment from "moment";

describe('HeaderMenu', () => {

  let component;
  const today = moment().format('YYYY-MM-DD');
  const bugUrl = 'https://github.com/project/project/issues';
  const docUrl = 'https://github.com/project/project/wiki';
  const homeUrl = 'https://www.project.tld/';
  const vcsUrl = 'https://github.com/project/project';

  const indexUrl = `http://localhost/index.php?project=CDash&date=${today}`;
  const overviewUrl = `http://localhost/overview.php?project=CDash&date=${today}`;
  const buildsUrl = `http://localhost/buildOverview.php?project=CDash&date=${today}`;
github Kitware / CDash / tests / Spec / build-summary.spec.js View on Github external
beforeEach(function() {
    this.axios = new AxiosMockAdapter(axios);
    config.mocks['$axios'] = axios;
    this.api_response = {
      build: {
        command: 'make',
        compilername: 'gcc',
        compilerversion: 4.4,
        endtime: 'later',
        errors: [],
        buildhistory: [],
        id: 1,
        lastsubmitbuild: 0,
        lastsubmitdate: null,
        name: 'my build',
        nerrors: 0,
        note: null,
        nwarnings: 5,
        osname: 'Linux',
github Kitware / CDash / tests / Spec / page-footer.spec.js View on Github external
import {mount, config} from "@vue/test-utils";
config.mocks['$baseURL'] = 'http://localhost';

import PageFooter from "../../resources/js/components/PageFooter.vue";
import expect from 'expect';
import moment from "moment";

describe('PageFooter', () => {
  let component;
  const currentdate = moment().format('YYYY-MM-DD');
  const endpoint = `http://localhost/api/v1/index.php?project=CDash&date=${currentdate}`;
  const generationtime = '0.01s';
  const nightlytime = '23:00 EDT';

  beforeEach(() => {
    component = mount(PageFooter, {
      data () {
        return {
github Kitware / CDash / tests / Spec / build-summary.spec.js View on Github external
import {mount, config} from "@vue/test-utils";
import axios from 'axios'
import AxiosMockAdapter from 'axios-mock-adapter';
import expect from 'expect';
import BuildSummary from "../../resources/js/components/BuildSummary.vue";

config.mocks['$baseURL'] = '';
axios.defaults.baseURL = config.mocks['$baseURL'];

import $ from 'jquery'
$.plot = function() { return null; };
global.$ = $

describe('BuildSummary', function() {
  let component;

  beforeEach(function() {
    this.axios = new AxiosMockAdapter(axios);
    config.mocks['$axios'] = axios;
    this.api_response = {
      build: {
        command: 'make',
        compilername: 'gcc',