我已将Bootstrap 4 import mock
def spy_decorator(method_to_decorate):
m = mock.MagicMock()
def wrapper(self, *args, **kwargs):
m(*args, **kwargs)
return method_to_decorate(self, *args, **kwargs)
wrapper.mock = m
return wrapper
class A:
def __init__(self, some_arg):
print("constructor")
def f(self, some_var):
print(some_var)
construct_spy = spy_decorator(A.__init__)
f_spy = spy_decorator(A.f)
p_construct = mock.patch('__main__.A.__init__', construct_spy)
p_f = mock.patch('__main__.A.f', f_spy)
m_construct = p_construct.start()
m_f = p_f.start()
a = A("hi")
a.f("car")
m_construct.mock.assert_called_once_with("hi")
m_f.mock.assert_called_once_with("car")
添加到我的角度6 "bootstrap": "^4.1.1"
应用中,但在运行SSR
时,我收到以下错误:
node server.js
我的vendor.ts:
!(function(t,e){true?e(exports,__webpack_require__(150),__webpack_require__(255)):undefined})(this,(function(t,e,c){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerab
le||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function h(r){for(var t=1;t<arguments.length;t++){var s=null!=
arguments[t]?arguments[t]:{},e=Object.keys(s);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(s).filter((function(t){return Object.getOwnPropertyDescriptor(s,t).enum
erable})))),e.forEach((function(t){var e,n,i;e=r,i=s[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i}))}return r}e=e&&e.hasOwnProperty("default")?e.default:e
,c=c&&c.hasOwnProperty("default")?c.default:c;var r,n,s,a,l,u,f,d,_,g,m,p,v,E,y,T,C,I,A,D,b,S,w,N,O,k,P,L,j,R,H,W,M,x,U,K,F,V,Q,B,Y,
TypeError: Cannot set property 'emulateTransitionEnd' of undefined
at J:\Java\workstation\front\.server\server.js:3538:2584
at J:\Java\workstation\front\.server\server.js:3538:2745
at J:\Java\workstation\front\.server\server.js:3538:22
at Object.<anonymous> (J:\Java\workstation\front\.server\server.js:3538:94)
at __webpack_require__ (J:\Java\workstation\front\.server\server.js:1:360)
at Object.module.exports (J:\Java\workstation\front\.server\server.js:3484:10746)
at __webpack_require__ (J:\Java\workstation\front\.server\server.js:1:360)
at J:\Java\workstation\exhibition\front\.server\server.js:1:1654
at Object.<anonymous> (J:\Java\workstation\front\.server\server.js:1:1702)
at Module._compile (module.js:643:30)
的WebPack:
window['jQuery'] = require('jquery');
window['$'] = window['jQuery'];
import 'bootstrap/dist/js/bootstrap.min.js';
有关此错误的任何想法?