summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSukanya Pandey <sukapan1@in.ibm.com>2020-03-19 07:53:23 +0300
committerDerick Montague <derick.montague@ibm.com>2020-03-26 19:36:45 +0300
commit5ee04ef522612e27d6fef02154bf23e45076ceee (patch)
treec6ea8c0cd403c8a72100294693ebde5e53ee7a79 /tests
parent30abccbed83aee950016c2da0ae5bf512df769dc (diff)
downloadwebui-vue-5ee04ef522612e27d6fef02154bf23e45076ceee.tar.xz
Add mocha and chai test framework
- Mocha/Chai/Sinon test frameowrk because it has 100% feature parity with vue-loader. - Code for making 'expect' function accessible globally. Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: Idf809cb08d8c1ef177ff92f0ee1be04ac74059a3
Diffstat (limited to 'tests')
-rw-r--r--tests/setup.js11
-rw-r--r--tests/unit/example.spec.js12
2 files changed, 11 insertions, 12 deletions
diff --git a/tests/setup.js b/tests/setup.js
new file mode 100644
index 00000000..e3c220a2
--- /dev/null
+++ b/tests/setup.js
@@ -0,0 +1,11 @@
+var chai = require('chai');
+var sinonChai = require('sinon-chai');
+
+chai.use(sinonChai);
+
+require('jsdom-global')('', {
+ url: 'http://localhost'
+});
+
+global.expect = require('chai').expect;
+global.sinon = require('sinon');
diff --git a/tests/unit/example.spec.js b/tests/unit/example.spec.js
deleted file mode 100644
index cb7abba3..00000000
--- a/tests/unit/example.spec.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import { shallowMount } from '@vue/test-utils';
-import HelloWorld from '@/components/HelloWorld.vue';
-
-describe('HelloWorld.vue', () => {
- it('renders props.msg when passed', () => {
- const msg = 'new message';
- const wrapper = shallowMount(HelloWorld, {
- propsData: { msg }
- });
- expect(wrapper.text()).toMatch(msg);
- });
-});