How to make ajax request with Karma -
i have test calls function requests external csv file. reason, can't use relative path. example, have do:
d3.csv('base/a.csv', ...
instead of being able :
d2.csv('a.csv', ...
the second example, works fine on actual site, reason, since karma runs in base
directory, have request base. how can normal relative url?
here parts of karma.conf.js
customized:
basepath: '', // frameworks use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['mocha', 'chai'], // list of files / patterns load in browser files: [ 'tests/*.js', 'bower_components/d3/d3.min.js', 'game.js', {pattern: 'a.csv', watched: false, included: false, served: true} ],
and here repo
Comments
Post a Comment