From 91d6a71a21d655f6f103de6a66a21ee4bdd352e3 Mon Sep 17 00:00:00 2001
From: Eliot Berriot <contact@eliotberriot.com>
Date: Mon, 8 Jan 2018 23:12:31 +0100
Subject: [PATCH] Can now launch tests

---
 front/package.json                                 |   1 +
 front/src/assets/logo/{favicon.ico => favicon.png} | Bin
 front/src/config.js                                |   2 +-
 front/test/unit/karma.conf.js                      |   5 ++++-
 front/test/unit/specs/Hello.spec.js                |  11 -----------
 5 files changed, 6 insertions(+), 13 deletions(-)
 rename front/src/assets/logo/{favicon.ico => favicon.png} (100%)
 delete mode 100644 front/test/unit/specs/Hello.spec.js

diff --git a/front/package.json b/front/package.json
index 58c22a40..e79ffcbe 100644
--- a/front/package.json
+++ b/front/package.json
@@ -46,6 +46,7 @@
     "cross-env": "^4.0.0",
     "cross-spawn": "^5.0.1",
     "css-loader": "^0.28.0",
+    "es6-promise": "^4.2.2",
     "eslint": "^3.19.0",
     "eslint-config-standard": "^6.2.1",
     "eslint-friendly-formatter": "^2.0.7",
diff --git a/front/src/assets/logo/favicon.ico b/front/src/assets/logo/favicon.png
similarity index 100%
rename from front/src/assets/logo/favicon.ico
rename to front/src/assets/logo/favicon.png
diff --git a/front/src/config.js b/front/src/config.js
index 3ba1247a..76a6f5e5 100644
--- a/front/src/config.js
+++ b/front/src/config.js
@@ -4,7 +4,7 @@ class Config {
     if (this.BACKEND_URL === '/') {
       this.BACKEND_URL = window.location.protocol + '//' + window.location.hostname + ':' + window.location.port
     }
-    if (!this.BACKEND_URL.endsWith('/')) {
+    if (!this.BACKEND_URL.slice(-1) === '/') {
       this.BACKEND_URL += '/'
     }
     this.API_URL = this.BACKEND_URL + 'api/v1/'
diff --git a/front/test/unit/karma.conf.js b/front/test/unit/karma.conf.js
index 3fcc5f02..da5a2187 100644
--- a/front/test/unit/karma.conf.js
+++ b/front/test/unit/karma.conf.js
@@ -14,7 +14,10 @@ module.exports = function (config) {
     browsers: ['PhantomJS'],
     frameworks: ['mocha', 'sinon-chai', 'phantomjs-shim'],
     reporters: ['spec', 'coverage'],
-    files: ['./index.js'],
+    files: [
+      '../../node_modules/es6-promise/dist/es6-promise.auto.js',
+      './index.js'
+    ],
     preprocessors: {
       './index.js': ['webpack', 'sourcemap']
     },
diff --git a/front/test/unit/specs/Hello.spec.js b/front/test/unit/specs/Hello.spec.js
deleted file mode 100644
index 80140baa..00000000
--- a/front/test/unit/specs/Hello.spec.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import Vue from 'vue'
-import Hello from '@/components/Hello'
-
-describe('Hello.vue', () => {
-  it('should render correct contents', () => {
-    const Constructor = Vue.extend(Hello)
-    const vm = new Constructor().$mount()
-    expect(vm.$el.querySelector('.hello h1').textContent)
-      .to.equal('Welcome to Your Vue.js App')
-  })
-})
-- 
GitLab