我正在尝试与Jest一起测试我的vue组件是否已实现bootstrap。
这是我对VoteComponent的测试:
`
import VoteComponent from '../../src/components/VoteComponent.vue'
import BootstrapVue from 'bootstrap-vue/src/index'
import { mount, createLocalVue } from '@vue/test-utils';
const localVue = createLocalVue();
localVue.use(BootstrapVue);
describe('VoteComponent', () =>
{
test('is a Vue instance', () =>
{
const wrapper = mount(VoteComponent, {localVue})
expect(wrapper.isVueInstance()).toBeTruthy()
})
})
`
这是我运行测试时终端显示的内容:
详细信息:
C:\...\...\...\...\...\node_modules\bootstrap\dist\css\bootstrap.css:7
:root {
^
SyntaxError: Unexpected token :
72 |
73 | <script>
> 74 | import 'bootstrap/dist/css/bootstrap.css'
| ^
75 | import 'bootstrap-vue/dist/bootstrap-vue.css'
76 | import VueFlip from 'vue-flip';
77 | import fontawesome from "@fortawesome/fontawesome";