This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import expect from 'expect' | |
import sinon from 'sinon' | |
import _ from 'lodash' | |
describe.only ('Debounce', () => { | |
let clock | |
beforeEach(() => { | |
clock = sinon.useFakeTimers(); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import { mount } from '@vue/test-utils' | |
import expect from 'expect' | |
import axios from 'axios' | |
import moxios from 'moxios' | |
import sinon from "sinon" | |
describe ('Test axios in mounted()', () => { | |
let wrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See https://stackoverflow.com/questions/47907000/testing-debounced-asynchronous-request-with-moxios-and-faketimers | |
import Vue from 'vue' | |
import { mount } from '@vue/test-utils' | |
import axios from 'axios' | |
import moxios from 'moxios' | |
import _ from 'lodash' | |
import expect from 'expect' | |
import sinon from 'sinon' | |
let Debounced = Vue.component('Debounced', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* call_user_func_array_cached | |
* | |
* @param function, variable args | |
* @return object | |
*/ | |
function call_user_func_array_cached( $function, $param_arr ) | |
{ | |
// ---------------------------------------------------------- |