Skip to content

Commit 2ec8788

Browse files
committed
Serve fonts
1 parent e0e6168 commit 2ec8788

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

karma.conf.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ module.exports = function (config) {
33
config.set({
44
browsers: ['ChromeHeadless'],
55
frameworks: ['browserify', 'mocha'],
6-
files: ['test/setup.js', 'test/components/*/*.spec.js'],
6+
files: [
7+
'test/setup.js',
8+
'test/components/*/*.spec.js',
9+
{ pattern: 'assets/fonts/icomoon.ttf', included: false, served: true }
10+
],
11+
proxies: {
12+
'/assets/': '/base/assets/'
13+
},
714
reporters: ['spec'],
815
preprocessors: {
916
'test/**/*.js': ['browserify']

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"dev": "watchify -vd -p browserify-hmr -e lib/main.js -o dist/build.js",
77
"lint": "eslint --ext .js,.vue lib test",
8-
"test": "karma start --single-run --browsers ChromeHeadless karma.conf.js",
8+
"test": "karma start",
99
"build": "cross-env NODE_ENV=production browserify -g envify -p [ vueify/plugins/extract-css -o dist/build.css ] -e lib/main.js | uglifyjs -c warnings=false -m > dist/build.js"
1010
},
1111
"browserify": {

test/setup.js

+5-13
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ except according to the terms contained in the LICENSE file.
1212
import Vue from 'vue';
1313
import 'should';
1414

15-
import { MockLogger, mockRoute } from './util';
15+
import { MockLogger } from './util';
1616
import { setHttp } from './http';
1717
import '../lib/setup';
1818

@@ -23,15 +23,7 @@ setHttp((...args) => {
2323
return Promise.reject(new Error());
2424
});
2525

26-
// Removes a component attached to the document if there is one.
27-
const removeComponent = () => $('body > script:last-of-type + *').remove();
28-
29-
afterEach(removeComponent);
30-
31-
// TODO. The first time a component is attached to the document, 404 errors are
32-
// returned for /assets/fonts/icomoon.ttf and icomoon.woff. I am not sure yet
33-
// why that is, but we attach a component here so that the errors are shown
34-
// before the first tests, not in the middle of the tests.
35-
mockRoute('/login', { attachToDocument: true })
36-
.then(removeComponent)
37-
.catch(e => console.log(e)); // eslint-disable-line no-console
26+
afterEach(() => {
27+
// Remove a component attached to the document if there is one.
28+
$('body > script:last-of-type + *').remove()
29+
});

0 commit comments

Comments
 (0)