Commit 8ca72d3f authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

some modifications

parent af2cb7da
Pipeline #1877 failed with stage
in 35 seconds
{
"presets": [
["latest", {
"es2015": { "modules": false }
}]
["latest"]
]
}
\ No newline at end of file
{
"extends": "standard",
"env": {
"jasmine": true
}
}
\ No newline at end of file
const webpackConfig = require('./webpack.config')
const webpackConfig = require('./webpack.config.js')
module.exports = config => {
config.set({
......@@ -6,9 +6,9 @@ module.exports = config => {
files: [
{pattern: 'test/**/*-test.js'}
],
browsers: ['PhantomJS'],
browsers: ['Chrome'],
preprocessors: {
'test/**/*-test.js': ['webpack']
'test/**/*-test.js': ['webpack', 'sourcemap']
},
webpack: webpackConfig,
webpackMiddleware: {
......@@ -17,7 +17,8 @@ module.exports = config => {
color: true
}
},
singleRun: true,
reporter: ['progress'],
singleRun: false,
colors: true
})
}
This diff is collapsed.
......@@ -6,20 +6,22 @@
"private": true,
"scripts": {
"build": "./node_modules/webpack/bin/webpack.js --config webpack.config.js --env build",
"devbuild": "./node_modules/webpack/bin/webpack.js --config webpack.config.js",
"test": "./node_modules/karma/bin/karma start karma.config.js"
},
"dependencies": {
"vue": "^2.2.4",
"vue": "^2.2.5",
"vue-template-compiler": "^2.2.5",
"vuex": "^2.2.1",
"axios": "^0.15.3"
},
"devDependencies": {
"babel-core": "^6.24.0",
"babel-preset-latest": "^6.24.0",
"babel-polyfill": "^6.23.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-core": "^7.0.0-alpha.3",
"babel-preset-latest": "^7.0.0-alpha.3",
"babel-polyfill": "^7.0.0-alpha.3",
"webpack": "^2.2.1",
"yargs": "^7.0.2",
"babel-loader": "^7.0.0-beta.1",
"vue-loader": "^11.1.4",
"css-loader": "^0.27.3",
......
import store from '../../store'
export default {
methods: {
loadDataForArgs (args) {
......
......@@ -12,7 +12,7 @@ class FractalJS {
// noinspection JSMethodCanBeStatic
loadData (descriptors) {
store.requestManager.createData(descriptors)
store.state.requestManager.createData(descriptors)
}
setChart (name, elementId) {
......@@ -25,6 +25,8 @@ class FractalJS {
}
}
export function init ({handler, thisBaseURL, fractalisBaseURL, getAuth} = {}) {
function init ({handler, thisBaseURL, fractalisBaseURL, getAuth}) {
return new FractalJS(handler, thisBaseURL, fractalisBaseURL, getAuth)
}
export { init }
import axios from 'axios'
export default class {
constructor ({handler, thisBaseURL, fractalisBaseURL, getAuth} = {}) {
constructor ({handler, thisBaseURL, fractalisBaseURL, getAuth}) {
this._handler = handler
this._thisBaseURL = thisBaseURL
this._getAuth = getAuth
......
import * as types from './mutation-types'
import types from './mutation-types'
export const setRequestManager = ({ commit }, manager) => {
commit(types.SET_REQUEST_MANAGER, manager)
export default {
setRequestManager: ({ commit }, manager) => {
commit(types.SET_REQUEST_MANAGER, manager)
},
setSubsets: ({ commit }, subsets) => {
commit(types.SET_SUBSETS, subsets)
}
}
export const setSubsets = ({ commit }, subsets) => {
commit(types.SET_SUBSETS, subsets)
}
\ No newline at end of file
export const SET_REQUEST_MANAGER = 'SET_REQUEST_MANAGER'
export const SET_SUBSETS = 'SET_SUBSETS'
export default {
SET_REQUEST_MANAGER: 'SET_REQUEST_MANAGER',
SET_SUBSETS: 'SET_SUBSETS'
}
import * as types from './mutation-types'
import types from './mutation-types'
export default {
[types.SET_REQUEST_MANAGER] (state, manager) {
......
import Vue from 'vue'
import Vuex from 'vuex'
import * as getters from './getters'
import * as actions from './actions'
import mutations from './mutations'
import getters from './getters'
import actions from './actions'
Vue.use(Vuex)
......
import 'babel-polyfill'
import store from '../src/store/store'
import RequestManager from '../src/services/request-manager'
describe('store', () => {
it('should have working setSubsets action', () => {
......@@ -7,4 +7,15 @@ describe('store', () => {
store.dispatch('setSubsets', subsets)
expect(store.state.subsets).toEqual(subsets)
})
it('should have working setRequestManager action', () => {
const requestManager = new RequestManager({
handler: 'ada',
thisBaseURL: 'https://localhost:1234',
fractalisBaseURL: 'https://localhost:4321',
getAuth: () => ({token: '1234567890'})
})
store.dispatch('setRequestManager', requestManager)
expect(store.state.requestManager).not.toBeNull()
})
})
const webpack = require('webpack')
const path = require('path')
const env = require('yargs').argv.env;
const env = require('yargs').argv.env
let plugins = []
let filename = ''
......@@ -15,7 +15,7 @@ if (env === 'build') {
module.exports = {
entry: ['babel-polyfill', path.resolve(__dirname, 'src/main.js')],
devtool: '#inline-source-map',
devtool: '#eval-source-map',
plugins: plugins,
output: {
path: path.resolve(__dirname, 'lib'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment