Commit bf75a678 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

Setting up test frameworks and integration with webpack

parent 415cc3ff
const webpackConfig = require('./webpack.config')
module.exports = config => {
config.set({
frameworks: ['jasmine'],
files: [
{pattern: 'test/**/*_test.js'}
],
browsers: ['Chrome'],
preprocessors: {
'test/**/*_test.js': ['webpack', 'sourcemap']
},
webpack: webpackConfig,
webpackMiddleware: {
stats: 'errors-only'
}
})
}
This diff is collapsed.
......@@ -19,22 +19,78 @@ export default class {
this._validateAuth(thisAuth)
this._validateServerURL(fractalisBaseURL)
this.handler = handler
this.thisBaseURL = thisBaseURL
this.thisAuth = thisAuth
this.fractalisBaseURL = fractalisBaseURL
}
loadData (descriptors) {
axios.post('/data', {
handler: this.handler,
server: this.server,
auth: this.auth,
descriptors,
this._handler = handler
this._thisBaseURL = thisBaseURL
this._thisAuth = thisAuth
this._axios = axios.create({
baseURL: fractalisBaseURL,
timeout: 1000
})
}
createData (descriptors) {
this._axios.post('/data', {
handler: this._handler,
server: this._thisBaseURL,
auth: this._thisAuth,
descriptors
}).then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
}
getDataStatusByParams (descriptor) {
const params = JSON.stringify({server: this._thisBaseURL, descriptor})
this._axios.get(`/data/${params}`).then(response => {
console.log(response)
}).else(error => {
console.log(error)
})
}
getDataStatusByID (dataID) {
this._axios.get(`/data/${dataID}`).then(response => {
console.log(response)
}).else(error => {
console.log(error)
})
}
getAllDataStatus () {
this._axios.get('/data').then(response => {
console.log(response)
}).else(error => {
console.log(error)
})
}
creareAnalysis (name, args) {
this._axios.post('/analytics', {
name,
args
}).then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
}
getAnalysisStatus (jobID) {
this._axios.get(`/analytics/${jobID}`).then(response => {
console.log(response)
}).else(error => {
console.log(error)
})
}
cancelAnalysis (jobID) {
this._axios.delete(`/analytics/${jobID}`).then(response => {
console.log(response)
}).else(error => {
console.log(error)
})
}
}
const path = require('path')
const config = {
module.exports = {
entry: './src/main.js',
output: {
path: path.resolve(__dirname, './lib'),
library: 'fractal',
filename: 'fractal.js'
},
devtool: 'source-map',
module: {
rules: [
{
......@@ -27,5 +28,3 @@ const config = {
}
}
}
module.exports = config
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